Scala is my new Ruby
March 19th, 2007 by aaronharnlyScala is my new Ruby, i.e. the language I love to tinker in. Rather more practical, too, as the fact that Ruby is dog-slow has gotten in the way of my work more than once recently.
Scala is my new Ruby, i.e. the language I love to tinker in. Rather more practical, too, as the fact that Ruby is dog-slow has gotten in the way of my work more than once recently.
In the category of tools that I want, but better not make right now, lest it turn into a “paroxysm of generalization”:
I have a DTD, describing a bunch of entities, their relationships, and their attributes. I’m going to push data from a set of XML files (adhering to said DTD) into a Ruby-on-Rails savvy database. Wouldn’t be nice to have a simple tool that, in the most general way possible, would, given that DTD:
Issue a series of ’script/general model Foo’ commands for the various entities.
Populate the Rails migration files appropriately, to manage the creation of the database tables for these entities. That would include inserting :foo_id columns for has-many and has-and-belongs-to-many relationships (though differentiating between the two might require some human supervision), and exploiting the wonderful Red Hill Foreign Key Migrations to create appropriate FK constraints.
In addition / as an alternative to using the Red Hill plugin, insert the appropriate has_many / habtm declarations in the model files.
And finally, make a script that can read a set of such XML files and fill the database appropriately.
Well, sounds nice to me, anyway. Put it on the someday-maybe list.
|
Copyright 2007 Aaron Harnly. Contact me by leaving a comment, or at (myfirstname)@harnly.net.
Entries (RSS) and Comments (RSS).17 queries. 1.083 seconds. |