On Monday 02 October 2006 02:34, David Guest wrote: > > that may have pay-offs later). I personally prefer the Django and > > Turbogears approaches of defining classes for data objects, rather than > > flat or relational database tables - it seems like a more modern and > > flexible. > > > > But doesn't Rails actually generate the classes from the database (or > perhaps) vice versa? The aim is to avoid doing the same work twice.
Rails uses introspection to the extreme - both ways. You can start with an established database schema and let Rails generate the corresponding objects (and with minimal manual help all complex relationships too). Or, you can formulate your schema in Rails, and using "migration" let the application generate the database on the fly Advantage of the latter is that your model becomes backend independent - AR would automatically choose the closest match for data types and referential mappings possible on the chosen backend (and warn you if something is not possible to map). Further advantage is that with migration you can safely update the database schema while "live" any time and roll back updates safely if something went wrong - that's a lot of work doing it manually Horst _______________________________________________ Gpcg_talk mailing list [email protected] http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk
