Some design guidelines for XSP pages.
In short: use Logicsheets.
The simplest XSP pages place the logic and expressions directly into the page, i.e. the functions are declared and invoked from the same page ('Embedded logic'). The cleanest way is to remove the logic into a separate page (a Logicsheet). This is the preferred way to create XSP pages.
As Logicsheets are implemented as transforms, they become reusable tag libraries:
- The XSP page contains a custom tag, in a custom namespace
This is translated into the equivalent logic using the Logicsheet transform.
- The XSP page is then compiled to code, as before.
This separation does provide the potential to implement tag libraries using different languages, although it's not clear if Cocoon supports a mixture of languages in a single XSP. Probably not...