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")
}
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With