On Sat, Apr 21, 2007 at 12:29:30PM +1200, Michael Koziarski wrote:
> Depends  on what your requirements are.   If you want a 'schema
> language' to help non-rails clients, why not use one that's been
> widely tested and has support in many different languages.  Making up
> something specific for rails would mean it's of questionable value to
> non-rails programming environments.

Along these lines, I've been investigating generating a W3C XML Schema
from a model and found it delightfully easy with just a bit of
reflection on AR::Base::columns.  Throw in a .xsd format and you've
got a great place to serve your schema.

One of the things I noticed was how similar the standard types for an
XML Schema were to the types used by #to_xml.  With just a few very
slight changes, Rails can be using a standardized list of types
instead of inventing its own.

I've refactored part of Hash::from_xml and in the process, added
support for the parsing end of things for these types.  This also
fixes a few issues as noted in the ticket I submitted it with.  It
goes without saying tests are included.  If there's interest, I can
fix up the generating part (the various #to_xml's) as well.

http://dev.rubyonrails.org/ticket/8047

> I'm not necessarily sold on the idea of generating a particular schema
> language, or even of generating a schema at all,  but I do know that
> inventing our own is something we should be very wary of.

I agree, most of this is destined for plugin land at most.  But I
think reusing the types in the core is a Good Thing.

Cheers,
Tim

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to