6

Does scalatra use circumflex behind the scenes (or vise versa)? What are the key differences between them, and which one would you use?

Both frameworks are inspired by Sinatra and from a glance look identical.

Request routing with scalatra:

class ScalatraExample extends ScalatraServlet {

get("/date/:year/:month/:day") {
  <ul>
    <li>Year: {params("year")}</li>
    <li>Month: {params("month")}</li>
    <li>Day: {params("day")}</li>
  </ul>
}

Sample code in circumflex:

class Main extends RequestRouter {

get("/posts/:id") = "Post #" + uri("id")

}
}
Vasil Remeniuk
  • 20,519
  • 6
  • 71
  • 81
  • They're both inspired by Sinatra, which accounts for the similar structure. They don't seem that similar in some other respects. Circumflex appears to be a lot more elaborate, as it includes features such as an ORM. This is the first time I've heard of Circumflex, actually. I don't know if one was forked from the other. I'm planning on checking it out too! – JAL Oct 30 '10 at 19:12

1 Answers1

4

Ross A. Baker, one of the Scalatra developers, has recently commented on the difference between Circu,flex and Scalatra:

They are superficially very similar, though I think each has its strengths. Here are some differences that I see:

Templating: Scalatra integrates with Scalate, Circumflex integrates with Freemarker.

Routing: Circumflex has nicer sugar for header matching, but Scalatra lets you match on arbitrary booleans (i.e., global flag for site maintenance)

ORM: Circumflex has one, Scalatra doesn’t. I know of Scalatra users using Squeryl, Querulous, Scala-Query, ORMBroker, and, yes, Circumflex-ORM. These integrations are trivial, and I assume would also be trivial with Circumflex.

Auth: Scalatra has an auth module in its latest snapshot, Circumflex does not.

i18n: Circumflex has sugar for message bundles, Scalatra does not.

Testing: Scalatra also includes a nice DSL for testing; I’m not aware of anything similar for Circumflex.

Vasil Remeniuk
  • 20,519
  • 6
  • 71
  • 81