Ramaze: Another Light Ruby Web Framework, But With MVC!
Ramaze is a simple, light weight (in a good way!), modular Web framework developed in Ruby. Like Rails, and unlike some of its newer competitors, such as Sinatra, Ramaze sticks to the MVC (Model, View, Controller) paradigm, making it more like a lighter, more modular Merb-alike. Ramaze is already a year old, and one thing that the official Ramaze Web site does right is provide lots of example code and documentation. The framework has also seen four releases in the last six months, a sure sign that someone cares about it.
Inspired by Ruby Inside's recent post, "Reprise: A Ruby-Powered Blogging App in 100 Lines Including Templates," Aman Gupta, one of the developers of Ramaze, has converted the code from a Sinatra-based non-MVC format over to the Ramaze equivalent, so you can get a direct comparison of the two different approaches by reading two sets of code for the same application.
November 23, 2007 at 8:42 am
I think it should be pointed out that, while not enforcing MVC, Sinatra in no way prohibits you from writing an MVC-style app.
It's easy to build discrete model classes, database-backed or otherwise, and templates in external files are supported. at it's core, it seems that most of the Sinatra DSL is essentially the (C)ontroller portion of MVC, and basically leaves it up to the developer to decide how to implement the remainder of the stack.
November 23, 2007 at 10:10 am
nice!
sometimes I need "one page one application just like Ramaze's hello world exmple"
November 23, 2007 at 10:55 am
Ramaze doesn't enforce MVC style in any way. When there's zero configuration, Ramaze acts as a VC. M can be easily plugged in with the ORM of your choice, of course.
Ramaze could also play the role of a simple file server(which would be pointless) with it's easily customizable Dispatchers. Customization is the thing I love about Ramaze - the code is really easy to understand and robust spec-tests tell me if I'm doing something wrong. Not to mention close to 100% covering documentation.
I've gone throught the route of PHP(spahghetti code), Rails, Nitro/Og and now Ramaze. Ramaze feels most comfy, thanks to: the freedom of choice(a hackers dream), zero configuration, simplicity and the most helpful community.
We have multiple Ramaze applications/portals/websites running live and I think the numbers will only grow. :)
November 23, 2007 at 4:54 pm
Reading this post and then the linked code, it looks like your definition of "MVC" requires separate classes for models, controllers, and (sorta) views.
In reality, Sinatra and Ramaze are both MVC web frameworks (in as much as any modern web framework claiming to be an MVC framework really follows MVC). I don't see any significant architectural/conceptual difference between the two frameworks.
November 23, 2007 at 5:13 pm
Almost /anything/ can be considered to be MVC depending on the angle you look at it. The truth is, they are pretty similar, but one project has used the term MVC and the other hasn't. The term MVC is reasonably bogus anyway as even systems that reinforce the concept can easily be used without it at all, such as Rails. It's really down to whether a system makes it easy to separate the concerns or not, and in this respect Ramaze seems more focused towards that than Sinatra.
November 23, 2007 at 10:51 pm
I wish Sinatra had a site with docs like Ramaze.
Actually, by way of framework sites, Merbivore's got them all beat on design right now. Blake should talk to whoever did that!
November 23, 2007 at 11:10 pm
As an aside, I want to do a big post about Merb soon. If anyone has any good links, tutorials they've written, stuff like that, do get in touch (or even leave them here in comments).
November 24, 2007 at 12:28 am
Sinatra is only six weeks old; it's fresh, very new, and has seen more press and more downloads than I had ever anticipated. I'm putting as much free time into it as I can.
The new site, and docs are all coming with the next release. And yes, they will show you how to move to MVC when needed because Sinatra doesn't assume you should start with it. I strongly believe in backing into a pattern. See Principles, Patterns, and Practices - Chapter 24 - by Robert Martin
If you want to see a great example of how to do so with the current release, check out:
http://blog.zerosum.org/2007/11/5/build-a-simple-pastie-clone-with-sinatra-datamapper-in-15-minutes
Until then...
get '/your_favorite_framework'
'and keep cranking out killer apps'
end
-Blake
November 24, 2007 at 12:54 am
Hey Peter-
Here are some good links for merb stuff:
http://pastie.caboo.se/pastes/121330
But I have to say that I really like both ramaze and sinatra. The ability to make small webapps all in one file is pretty sweet and it's something merb doesn't do.
November 24, 2007 at 6:00 am
Ezra, Merb lacks a few things - and it hurts Merb badly (i and several people I know would use Merb except...) a) no community forums.... where should I share my merb knowledge? the irc channel? no thanks. too disposable... A community forums could do wonders for the progression of Merb. b) Sample apps that actually work.
November 27, 2007 at 4:35 pm
All due respect to the developers of these frameworks, but who cares? Why do we need 5 different versions of "Rails-lite"? Honestly, wouldn't these guys be better off joining forces with Ezra on Merb or something?
December 13, 2007 at 8:34 pm
Two points.
"Ramaze sticks to the MVC (Model, View, Controller) paradigm, ..."
Not really. Ramaze makes it easy to build MVC Web apps, but also makes it easy to roll out single-file, PHP/ASP-like sites as well (a feature also found in Nitro, from which much of Ramaze seems drawn.)
To "Curious User": Ruby does not have five versions of "Rails lite." The various Ruby Web frameworks (some of which predate Rails) are each interesting approaches to Web development. Each is opinionated software, and the diversity of opinions is refreshing.