From: Chris W. <ch...@cw...> - 2004-12-15 00:03:55
|
On Dec 10, 2004, at 6:28 PM, Coder wrote: > I am having trouble understanding how the OI2 architecture models > entity > relationships in code and susequently referes to the at run time. There are a couple of things to separate here. - OI2 uses SPOPS for its entities. This might change to be more flexible, but not in the very near future. - OI2 has very good support for SPOPS as an object-relational mapping tool - OI2 does not preclude other mapping tools The only reason OI2 does not support Class::DBI is that nobody who has known enough about Class::DBI has stepped forward as a guinea pig to test out integration. (Which should actually be quite minor.) Will you be the first? :-) Here's what I mean by minor: - Class::DBI objects should be able to use OI2 datasources. This means you'll only have to define database information in one place. I assume this means you wire up a method in Class::DBI to return a database handle on demand, but that might just be how I think about things. (This is very easy, BTW.) - We need to initialize Class::DBI objects at startup. This could be as simple as listing a set of class names and having OI2 require() them all. (Also very easy.) - Is there any data definition language manipulation? That is, so you can do something like: My::Class::DBI->create_tables( 'mysql', $dbh ); I think that's it. There are likely other possiblities -- looking up a CDBI class by name vs hardcoding a class name (like the rest of OI2), doing any one-time initialization at package installation. Is there anything I'm missing? Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |