Forum OpenACS Development: Re: Functions in .xql files...

Collapse
Posted by Jun Yamog on
Hi,

Those db api are real expensive.  Although there are some queries that they make sense.  If the result set is only one, and I need to make use them on the select clause I use them.

Anyway the way I think we can do abstaction is on the tcl level.  Like in the cms that I am working on I there is a tcl proc "get_item -revision live".  This provides abstraction for developers that has less knowledge in CR.  More advance developers can go into just querying the data model directly.  Another advantage of abstraction either on tcl or sql is that we can fix optimization centrally.  Let say "get_item" tcl proc had a performance problem. When I fix the query things will get fixed, without hunting down those query with grep.

CCM does also try to provide this abstraction on the Java level.  Like its possible to have "ContentItem item = ContentItem.getLive(itemID);"