Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

PGObject Framework: Feedback?

by einhverfr (Friar)
on Nov 17, 2013 at 15:18 UTC ( #1062995=perlmeditation: print w/replies, xml ) Need Help??

Fellow monks

I am the principle developer of LedgerSMB and the maintainer, currently, of everything in the PGObject space. I wanted to post my thoughts about what this is and get thoughts from the community as I look at building new components to this framework.

PGObject is an extensible object framework with close (and yet only loosely coupled) PostgreSQL integration. The namespace consists of utilities, mapper classes, and type handlers, which allow one to write code that works in an object-oriented framework, often with Moo or Moose, and where methods map often to database stored procedures. The stored procedures are then looked up by a convention set by the relevant class or role, and then methods are mapped in using the routines of the relevant mapper.

Currently I have one mapper class (and an associated Moo role) and four type handlers. The mapper class uses a simple argument name to property mapping convention with an optional "in_" at the beginning of the argument name being stripped off during the mapping process (so in_id maps to the object property of "id"). The relevant SQL to call the function (along with Windowing functions requested etc) is generated and sent to the db. When using this via Moo, you get an added ability to declare such mappings declaratively.

I am also working on another mapper class that would serialize the object to a composite type. This would allow the entire object to be passed in, creating a single SQL literal representing the entire object as a possibly nested tuple. The application for this is to pass in complex financial transactions in directly so that pre-insert checks an be run on the full set of data as a set.

Is this something that other folks would find very useful and if so, what other features should I look at adding?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://1062995]
Approved by Old_Gray_Bear
Front-paged by Old_Gray_Bear
and all is calm...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-02-17 23:43 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (250 votes). Check out past polls.