Login  Register

Re: Ofbiz and Ruby on Rails

Posted by davidnwelton on Aug 05, 2006; 6:09pm
URL: http://ofbiz.116.s1.nabble.com/Ofbiz-and-Ruby-on-Rails-tp170367p170377.html

> My curiosity is that there are several reasons why
> various people are attracted to this project
> 1) The data model (data layer)

Yes!

> 2) The framework (database manipulation, etc)

It works.

> 3) The applications (business logic)

Definitely.

> 4) The widgets (presentation layer)
> 5) and so on

The community - being able to interact with others who have similar
ideas and needs.

> The data model is what it is and can be used in any
> framework.

I'm a huge Ruby on Rails fan, and have basically switched to using it
for all my own stuff.  I think for a small application, it's
significantly more productive and efficient than the OFBiz framework.
However... I think you seem to have some misconceptions about RoR.
For instance, the OFBiz data model could not be used as is with RoR
because some tables have multiple primary keys, something that RoR
takes care of with an artificial primary key.

> The time consuming part of the business logic doesn't
> come from the lines of code, but the thought process.
> Since the thought process is fairly straight forward,
> rewriting the business logic in another language would
> be a fairly small project.

I'm skeptical.

> Half of the presentation layer (at least on the
> backend) is created automatically with RoR's scaffold.

I think you misunderstand what scaffolding gives you.  Its true value
is that it gives you a starting point, but it doesn't give you a final
version.  You would almost never want to put scaffolding code into
production.  What's handy about it is that it gives you a skeleton to
start modifying, which makes things quicker and easier because it's
very easy to see how things are done.

>  So, that's a fairly small project to translate with
> huge UI benefits compared to the OFBiz community
> project's current UI.

What I feel are the strengths of RoR are:

*) You use just enough code to say what you mean and no more.  Instead
of stuff like setVariable("foobar", foobar), you just have @foobar =
12, and you can use that in both the controller and the view.

*) It's so easy to get started and crank out functional code.

*) It's got a big, relatively intelligent development community.

What it doesn't have is the specific business knowledge that the OFBiz
community has.  Perhaps Java is also a performance win, as well.

> The discussion I'm after isn't so much about changing
> Java to RoR, but hypothetically what does one lose by
> leaving Java for RoR and can the apparent benefits of
> RoR be obtained in a Java based OFBiz?

I think some of the principals are applicable, but Java just isn't as
dynamic as Ruby...  I don't know OFBiz' internals well enough to
comment on specifics, but I definitely think that for the core guys,
spending a few days with RoR to get some ideas would probably be a
beneficial use of their time.  One of my favorite things about RoR,
for instance, is "don't repeat yourself" - you write stuff only once,
if possible, and the framework figures out the rest for you.  OFBiz
tends to have the same, or similar names scattered all over the place.
 In most cases, you don't really want to configure stuff much... good
defaults would work well enough.

OTOH, OFBiz is pretty big, and what works in Rails might start to
creak under such a big load.

> If the answer is that you don't lose much by switching
> to RoR and the benefits of RoR cannot be easily
> obtained in a Java based OFBiz, then the question
> should be about changing Java to RoR.  There seems to
> be a lot of interest in improving the UI in OFBiz, but
> not so much through the tools that currently exist.
> If you don't lose much with RoR on functionality, why
> reinvent the wheel, just throw on some new racing
> slicks ;)

My guess is that isn't likely to happen.  It probably just makes more
sense to start a RailsBiz project from the ground up in order to
structure things in such a way to conform to how rails does things.
It wouldn't be an easy undertaking, though...  There's a lot of
knowledge and experience wrapped up in OFBiz.

--
David N. Welton
 - http://www.dedasys.com/davidw/

Linux, Open Source Consulting
 - http://www.dedasys.com/