Forum OpenACS Development: TCL API vs includelets for html snippets

Is this an accurate statement of OpenACS best practices?
  • Functions which output formatted HTML intended for reuse in other contexts should be implemented as tcl/adp includelets and stored in /packages/yourpackages/lib.
  • Functions which output unformatted variables or TCL data structures (lists, arrays, etc) intended for re-use should be implemented as public API functions.
Collapse
Posted by Malte Sussdorff on
It meets my assumption of an OpenACS best practice, so I'd say it is accurate.
Collapse
Posted by Don Baccus on
yessir
Collapse
Posted by Mark Aufflick on
what are the performance implications of this? does aolserver/acs rp do any smart caching of includes?

if not it probably should have that option, and then we wouldn't be tempted to use util_memoize and procs.

Collapse
Posted by Don Baccus on
Templates are compiled into Tcl and the Tcl is compiled into bytecode and the result of that is cached.

The timestamp on the template is checked to make sure it hasn't changed, then the bytecode is executed.

So the overhead is minimal.