I'm trying to consolidate + standardize some code.
I realized several manager methods were identical, so I merged them
into a shared manager class.
Can anyone suggest a better way than what follows ?
Basically, I just have these objects inherit from another manager
subclass, which calls $class->object_class() instead of object_class
() like in the rose docs.
I'm just wondering if there's a better way
===========
package Myapp::RoseDB::Object::_SharedManager_A;
use base qw(Rose::DB::Object::Manager);
sub load_item {
my ( $class, %kw_args )= @_ ;
my $results= Rose::DB::Object::Manager->get_objects(
object_class=> $class->object_class(),
...
}
===========
package Myapp::RoseDB::Object::Artist;
use Myapp::RoseDB::Object::_SharedManager_A ();
use base qw(Myapp::RoseDB::Object::_SharedManager_A);
use Myapp::RoseDB::Object::Artist;
sub object_class { 'Myapp::RoseDB::Object::Artist' }
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object