Brzy Web Application Framework

Brzy Framework

Brzy is a suite of tools to to make application development simpler, and easier to maintain.

Last updated Oct 25, 2011, New revisions are listed on the right bar.

Fab(ricate)

Fabricate is a maven like declaritive, domain centric build tool. It starts with the idea that all configuration should be simplified with sensible defaults, and no other configuration. But extendable with modlues, that add dependencies, configuration and runtime services.

Example Config

application:
  name: &name brzy-website
  org: org.brzy.website
  version: "1.0"
  author: Michael Fortin
  description: &desc Brzy Web Framework Website
  webapp_context: /
  application_class: org.brzy.website.Application

persistence:
  - name: brzy-squeryl
    org: org.brzy
    version: "0.8-SNAPSHOT"
    driver: org.h2.Driver
    user_name: sa
    password: ""
    url: jdbc:h2:test_db

repositories:
- {id: scala-tools, url: http://nexus.scala-tools.org/content/repositories/releases}
- {id: maven-central, url: http://repo1.maven.org/maven2}

dependencies:
- {conf: compile, org: com.h2database, name: h2, rev: "1.2.133", transitive: false}
- {conf: test, org: junit, name: junit, rev: "4.8.1"}
- {conf: test, org: org.scalatest, name: scalatest, rev: "1.2", transitive: false}
- {conf: test, org: org.scala-lang, name: scala-library, rev: "2.8.0", transitive: false}
# ...
				

Brzy Webapp

Brzy Webapp is a action based, partially RESTful web framework done in Scala and built using fabricate.

Example Model View Controller

class Person( override val id:Long,
    @Column(name="first_name") val firstName:String,
    @Column(name="last_name") val lastName:String) 
    extends KeyedEntity[Long] {
  lazy val addresses: OneToMany[Address] = Person.personToAddresses.left(this)
}

object Person extends SquerylDao[Person] {
  val personToAddresses = oneToManyRelation(Person.db, Address.db).via((p,a) => p.id === a.personId)

  override def valid(t:Person) = Validator(t)
      .check("firstName",NotNull(),Size(2 to 36))
      .check("lastName",NotNull(),Size(2 to 36))
      .violations
}

class PersonController extends CrudController("persons",Person)

//

Calista

Calista is a scala api for accessing a Cassandra Datastore in scala.

// single column manipulation
val standardColumn  = "Family" | "key" |("column", "value")		

// object to column mapping
case class Person(key:String,name:String,count:Int,created:Date)  extends KeyedEntity[String]

object Person extends Dao[String,Person] {
def columnMapping = new ColumnMapping[Person]("Person")
		.attributes(UTF8Serializer, Array(
			Attribute("key",true),
			Attribute("name"),
			Attribute("count",false,IntSerializer),
			Attribute("created",false,DateSerializer)))
}