What Are the Main Differences Between Sinatra and Ramaze

What are the main differences between Sinatra and Ramaze?

Sinatra does not enforce MVC.

Does Ramaze have a Sinatra like before/after hooks?

Their documentation tells you that it does. For instance:

before(:index, :other) do
puts 'Executed before specific actions only.'
end

after(:index, :other) do
puts 'Executed after specific actions only.'
end

What do you use Sinatra for?

Sinatra is not Rails. It is a micro-framework used for simple websites where you may need to just define a few actions. You can make a Sinatra application as complex as you want to, but you'll hit a point where you code has become a crazy mess sooner than with Rails.

While not 100% accurate, Sinatra fits mostly into the Page Controller architectural pattern, and Rails is a clear MVC implementation.

To answer your questions specifically:

  • It is not intended to replace Rails
  • It can run side by side
  • You could create a twitter clone in Sinatra

Small web-framework like Sinatra, Ramaze etc in .NET

I just discovered Nancy: https://github.com/NancyFx/Nancy.

This is an introduction from the author blog: http://elegantcode.com/2010/11/28/introducing-nancy-a-lightweight-web-framework-inspired-by-sinatra/

Rails 3 vs Sinatra

Your data model is fairly complex, so I imagine your application will have to handle a significant number of business rules and interaction possibilities.

Sinatra is meant for handling lightweight software architectures. If you choose Sinatra you'll probably encounter design and organization issues you'll have to handle by yourself. Rails implements the MVC pattern and can help you organize your code by offering a lot of useful mechanisms.

You still can build a "full-stack" web app with Sinatra but you'll have to do a lot by yourself especially if the amount of functionality you'll provide is high (or will grow). I think Rails fits naturally better in larger architectures.

PS : ActiveRecord is available both in Sinatra and Rails.

Are there any Ruby MVC web frameworks with great support for logic-less templates?

You might want to look at Padrino, it's based on Sinatra, but is more of a MVC framework than Sinatra is out of the box.



Related Topics



Leave a reply



Submit