Forum: Ruby on Rails Re: Newbie Question about Custom Classes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Victor K. (Guest)
on 2006-03-20 18:30
(Received via mailing list)
I did a CMS framework for a newspaper in Java, using the Spring J2EE
framework.
There, I created an XML DAO layer, and then had XMLbean NewsML business
objects instantiated by the controller accessing the DAO layer (which
talked
to an Xindice server!).
(By the way, it's been working in production for ages, stable as heck...
WISH RAILS 1.0 HAD BEEN THERE THEN... took me months to develop, instead
of
the weeks it would have taken on Rails, not to mention some javascript
sprite action that would have been a heck of a lot simpler!).
The great thing about treating the persistent XML (whether files, a
server
like XIndice, etc.) as a data access layer meant that if later I decided
to
use MySQL or Berkeley XML database, I would only have to modify that
layer.

Now...

On Rails, just simply have your controller instantiate a business object
(a
model class) that knows how to read/write XML from/to flat files. This
can
be by invoking a library, or, to get more sophisticated, by writing a
data
access adapter for flat XML files (ActiveRecord/ConnectionAdapters) (my
Rails ignorance prevents me from knowing whether this already exists as
a
third party; the API doesn't mention any).

Hope that helps.

Victor K.
http://awebfactory.com.ar

Date: Mon, 20 Mar 2006 10:37:36 -0500
This topic is locked and can not be replied to.