Best approach when data store is XML instead of a database?

Hi all,

Does anyone know of an approach/plugin that for model classes persisted
to XML, as ActiveRecord works with databases? I’m aware of
ActiveRecord::XMLSerialization, but I’d like to expand on that in two
ways:

  1. The ‘to_xml’ method currently serializes descendant objects only when
    explicitly specified. I need to be able to say ‘to_xml(:include =>
    :all)’, so a complete document is written.

  2. I’d like the XML schema to drive the definition of the model classes
    (like ActiveRecord). Doesn’t matter to me if that happens at run time
    or via a rake task.

We’re trying to avoid the ORM quagmire. We have complete control over
both the XML schema and the model classes, so we can change the schema
if necessary.

Thanks,

Brian

Brian H. wrote:

Hi all,

Does anyone know of an approach/plugin that for model classes persisted
to XML, as ActiveRecord works with databases? I’m aware of
ActiveRecord::XMLSerialization, but I’d like to expand on that in two
ways:
[…]
We’re trying to avoid the ORM quagmire.

Um, what “quagmire”? Have you worked with Rails ActiveRecord? It’s
remarkably easy to use and versatile. And it looks like you’re jumping
straight into the XML quagmire as a result – many people have tried to
use XML files as databases, but I know of no decent way to do so with
any scalability (eXistDB?).

I think you’re prematurely optimizing here. Use a real DB.

We have complete control over
both the XML schema and the model classes, so we can change the schema
if necessary.

Well, that means you’d have complete control over a real DB too, right?

Thanks,

Brian

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]