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

Posted by Peter Marklund on

I agree with Don here and feel we need to make more calls on the Tcl level. We should make the Tcl API our primary means of abstracting away underlying implementation and encapsulating business logic.

Using a Tcl API becomes exceedingly important as we use more and more caching and Tcl callbacks. Bypass the Tcl API and callbacks and caching will not work.

One of the most powerful patterns in software development that I have come across is the Observer pattern (with a publisher, a subscriber, events, and callbacks). By making the OpenACS kernel publish a set of callbacks we in effect give applications the power to customize the behaviour of the kernel without forking it.

We recently added callbacks related to installation, instantiation, and mounting of packages that are already proving very useful. I could imagine great value in having other types of callbacks such as before-request, after-request, after-user-instantiate, after-group-instantiate, after-user-register etc. etc.

Using callbacks can help us achieve upgradability, something that I feel strongly about these days, and I wrote a little comment about it in my Blog this morning.