Jonas Alves wrote:
> Hi,
> I''m doing a research for college about using Rails for enterprise
> application development versus an MVC Java framework using struts and
> OJB. I need to refer all the architectural patterns, since the data
> source and domain logic patterns till the web presentation patterns.
> Could you guys please tell me the pros and cons you found about using
> Rails.
I''m rather new RoR and Ruby so please keep that in mind before
continuing..
Having lots of experience using PHP4 and PHP5, and some J2EE (struts,
hibernate) and can quite easily say RoR is my #1 choice for future
applications, PHP5 being a close second and Java a distant 3rd. I''ll
admit this has a lot to do with my experience in writing medium scale
PHP webapps. I know lots of usefull PEAR classes and other scripts that
allow me to be very productive. JAVA has so far been a great
disappointment. Lots of configuration files, all this static typing and
exceptions that *have* to be caught etc etc. I find it hard to read and
very verbose. It''s just in my way and I don;''t consider it to
be
practical at all.
RoR is a very productive enivironment, especially when you''re doing
simple stuff or prototyping. This is partly due to RoR but certainly
also because of Ruby. Ruby has so far proved to be a very cool language
that stimulates a practical and highly modularzied style of coding.
With RoR, the way things work is very close to the way I *personally*
work with PHP (e.g. code generators, scripting language, usefull classes
I can build on). That said, RoR does almost everything I do in PHP, but
it does it better. It closely follows my view on how to build a simple
to medium webapp, but it provides better tools than my homegrown PHP
code and PHP/PEAR classes combined.
As for the cons, the two main areas in which I think RoR is lacking are
i18n and forms. I like the way forms are done, but they are mapped too
closely to Active Record if you ask me. It;s hard to create some easy
validation rules for forms that are not related to an AR model. I read
it can be done, but with some extra effort that I think should not be
necessary. Some bits of the AR validation errors seem to be hardcoded
can only be changed if overwrite some methods, which is not something
you want to get into I don''t think.. Also there is no proper IDE supprt
yet, but that is changing, Radrails for instance seems to be a nice IDE
although it''s only in a very early stage.
I think these two areas will get addressed and even with these
"problems" I still think RoR makes a lot of sense and I think a lot of
developers will be happy to see that there is at least one framework out
there that allows us do what we do a lot faster, without us radically
changing the way we work. At least that''s what my experience is. For me
it''s very similar to working with PHP/Smarty/ and
PEAR::Quickform/DataObjects/Pager - but a lot more integrated (and fun!).
Hope that helps!
Jeroen