On 4/13/07 11:08 PM, Bill Moseley wrote:
> On Fri, Apr 13, 2007 at 07:40:04PM -0700, Bill Moseley wrote:
>> This is still the current situation?:
>> 
>>     http://www.dev411.com/blog/2006/05/31/rose-db-object-aggregates
>> 
>> i.e. Run you own SQL directly with DBI or use Views and a create a
>> table (and manager) class for each one?

Yes, although hybrid approaches are possible, as you suggest here:

> Perhaps use get_objects_from_sql and add extra methods to the table
> (or even base) class?
> 
>    From get_objects_from_sql
> 
>    Each column returned by the SQL query must be either a column or
>    method name in "object_class".  Column names take precedence in the
>    case of a conflict.
> 
> Maybe pick a few generic names
> 
> use Rose::Object::MakeMethods::Generic (
>     scalar => [ qw/  count total average temp_column / ],
> );

...but I'd caution against that approach as it's no longer clear what save()
or load() would do on such an object.  (It's probably slightly better to
make a "dummy" result class that overrides load(), save(), insert(), and
update() to throw exceptions, but that's still pretty ugly, IMO.)

-John



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to