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

Re: Self-documenting API Proposal



Chris,

> He was talking about an approach to ORM.  I am essentially talking
> about the same thing but encapsulating it in the db where it can be
> app-independant.

Right.  This is David Fetter's idea, actually .... one he implemented for a 
game company.  It consisted of the simple idea of a method/function map, 
i.e.:

gl.modify = modify_gl(account1, account2, amount, is_debit)

This has the advantage of both providing some ORM and being "self-documenting" 
in a single package.  Since OO programming is not a big concern for us, we 
wouldn't adopt David's specific approach, but I can certainly see having a 
centralized function map. 

> I can get argument types out, but not argument names. 

Eh?  Why not?

-- 
Josh Berkus
PostgreSQL @ Sun
San Francisco