[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PGObject framework todo's to be ready for use in 1.5



Hi;

I will be releasing PGObject::Simple 1.5 shortly which will support a contextual return, so if you $ref = $object->call_dbmethod(...) it will return the of the result set.  This will then be supported in PGObject::Simple::Role.

At this point, for a stable framework there I only have one other todo item, namely to modify PGObject::Simple::Role so that it handles lazy attributes properly.  Handling lazy attributes (i.e. attributes which are first set when they are requested) is something that the current 1.4 framework doesn't do so well.  This would eliminate one significant headache. 

The other thing I want to do is remove the dbmethod() syntax entirely from PGObject::Simple::Role.  This has been moved into PGObject;:Util::DBMethod, which has a significant number of advantages.  Classes can simply use this class and then be able to:

dbmethod save => (funcname => 'save');

instead of a more cumbersome 

sub save {
    my ($self) = @_;
    return $self->call_dbmethod(funcname => 'save');
}

Or for more features:

dbmethod save_as_new (funcname => 'save', strict_args => 1, args => {id => undef});

Once these are done, I will release PGObject::Simple::Role 1.0  I think the API we are looking at can be reasonably guaranteed for the foreseeable future.

There are a bunch more things this framework supports including:

1.  multi-schema
2.  function name prefixes
3.  Overriding named arguments
4.  Running aggregates over return values from the functions.
5.  Registered types which grab columns of specific types and convert to Perl objects of named types.
6.  Everything our current DBObject framework supports
7.  Classes, if needed (for integration purposes) can override the default database connection.

All with a lot less boilerplate and a lot less cruft.  The syntax is mostly compatible with what we have now, so I don't expect to spend more than a day or two moving code over after we branch.

I am actually extremely happy with my forays into it currently.  It isn't a major paradigm shift, but it smooths out a lot of rough corners.

--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.
http://www.efficito.com/learn_more.shtml