:: Topo :: doCoding :: Linguagens de Programação :: Ruby ::
MVC
Objectivo
Esta WikiPage tem como principal objectivo listar as diversas MVC Frameworks, codificadas em Ruby, e que existem ou que vão surgindo ao longo do tempo com destaque. Não irão portanto ficar registadas frameworks que desapareçam rapidamente ou que tenham pouca notoriedade.
Referências
Frameworks
Web
Heavy
- Ruby On Rails - Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp. It reached stable v1.0 on December 13th of 2005 and v2.0 nearly 2 years later.
- Merb - Design by Ezra Zygmuntowicz and currently developed by Yehuda Katz and his team, it reached stable v1.0 on November 7th of 2008.
- Mack Framework - In February 2008, Mark Bates began development of the Mack Framework. Mack aims to provide a simple, easy to use, Ruby based web framework that makes developing distributed, portal-like web applications a snap. With features such as distributed routing, objects, and views/layouts, developing multiple applications that link together has never been easier.
- Waves - Waves makes it easy to go beyond applications and focus on architecture. Waves embraces HTTP and REST instead of trying hide them from you with one-size-fits-all abstractions.
Light
- Camping - Camping is a web framework which consistently stays at less than 4kb of code, and is maintained by why the lucky stiff.
- Ramaze - Ramaze is a very simple and straight-forward web-framework. The philosophy of it could be expressed in a mix of KISS and POLS, trying to make simple things simple and complex things possible. The original purpose of Ramaze was to act as a kind of framework to build web-frameworks, this was made obsolete by the introduction of rack, which provides this feature at a better level without trying to enforce any structural layout of the resulting framework.
- Sinatra - Unlike Ruby on Rails, Sinatra is not a Model-View-Controller (MVC) based framework for creating websites. If you want helper functions that help you create forms, connect to databases, or any of the other myriad of functions that Rails provides, you will not find them. Instead, Sinatra is a very simple, yet powerful, Domain Specific Language (DSL) for defining RESTful HTTP actions, and then defining how the application is going to respond to them.
- Halcyon - Halcyon is a JSON Web App Framework built on Rack for speed and light weight. Simply put, Halcyon is a web application framework with a twist. The twist is simply that Halcyon applications communicate solely through JSON, both incoming and outgoing. It is ideal for creating light-weight service application layers, such as APIs for existing apps, etc.
- Kiss - Kiss uses elements of the Model-View-Controller (MVC) and Model-View-Presentation (MVP) design patterns, to enable clear separation of business logic (what the app does) and presentation (how the app looks and behaves). Using Kiss, developers can create web applications with greater speed and flexibility, less tedium, and easier maintenance than with other frameworks.
Servers
- Webrick - WEBrick is a Ruby library program to build HTTP servers.
- Mongrel - Mongrel is a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI. It is framework agnostic and already supports Ruby On Rails, Og+Nitro, Camping, and IOWA frameworks.
- Evented/Swiftiply Mongrel - Swiftiply is a backend agnostic clustering proxy for web applications that is specifically designed to support HTTP traffic from web frameworks.
- Thin - Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history. Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server bundled in an easy to use gem for your own pleasure.
- Ebb - Ebb aims to be a small and fast web server specifically for hosting dynamic Ruby language web applications.
- Passenger - Phusion Passenger — a.k.a. mod_rails or mod_rack — makes deployment of Ruby web applications, such as those built on the revolutionary Ruby on Rails web framework, a breeze. It follows the usual Ruby on Rails conventions, such as “Don’t-Repeat-Yourself”. Phusion Passenger is commercial supported open source product that enables people to deploy their Ruby on Rails applications in an upload-and-go manner, which is very reminiscent of the PHP way of deploying. Phusion Passenger's ability to automatically manage Rails server processes lowers system administration, while retaining stability/robustness and performance.
- Rack - Rack provides an minimal interface between webservers supporting Ruby and Ruby frameworks.
ORM
- ActiveRecord - Active Record connects business objects and database tables to create a persistable domain model where logic and data are presented in one wrapping. It‘s an implementation of the object-relational mapping (ORM) pattern by the same name as described by Martin Fowler. Active Record‘s main contribution to the pattern is to relieve the original of two stunting problems: lack of associations and inheritance. By adding a simple domain language-like set of macros to describe the former and integrating the Single Table Inheritance pattern for the latter, Active Record narrows the gap of functionality between the data mapper and active record approach.
- Sequel - Sequel is designed to take the hassle away from connecting to databases and manipulating them. Sequel deals with all the boring stuff like maintaining connections, formatting SQL correctly and fetching records so you can concentrate on your application. Sequel uses the concept of datasets to retrieve data. A Dataset object encapsulates an SQL query and supports chainability, letting you fetch data using a convenient Ruby DSL that is both concise and flexible.
- Stone - For small applications, a database can be overkill for storing your data in a consistent and organized manner. Therefore, Stone was built to provide plug-and-play data persistence for any application or framework. It is fast, and it is easy… therefore it is good.
- M4DBI - M4DBI is a Ruby library that provides ORM modelling and more to the Ruby DBI library.
Templating
- Erb
- Eruby - eRuby is a language to embed Ruby codes into text files. For example, you can embed Ruby codes into HTML files.
- Erubis - Erubis is a fast, secure, and very extensible implementation of eRuby.
- Haml - Haml takes your gross, ugly templates and replaces them with veritable Haiku. Haml is the next step in generating views in your Rails application. Haml is a refreshing take that is meant to free us from the shitty templating languages we have gotten used to. Haml is based on one primary principle. Markup should be beautiful.
Considerações
2009.02.07
A escolha mais sensata, apesar da framework Merb em modo very-flat ou flat ser mais rápida, é seguir com a framework Ramaze. Porque além de muito simples, é realmente bastante agnóstica. A framework Sinatra é ainda estável, não devendo de todo ser usada com Windows.
Não se deve usar JRuby, por ser penalizador em termos de performance, e não se deve em caso algum usar Webrick. O servidor sob Rack deve ser o Mongrel ou se possível o Thin, que são ambos muito superiores em desempenho ao Webrick.
Pela investigação efectuada - artigos online somente - o Haml está considerado tão ou marginalmente mais rápido do que o Erb, e ambos são batidos pelo Erubis. No entanto, não vem por omissão a possibilidade de ser o Erubis escolhido como templating engine no Merb e no Sinatra - o que é mais uma vantagem Ramaze.