I'm currently working on a more-than-average sized cforms applications. We have quite a few usecases where validation is kind of a PITA, requiring quite a few of business logic to be performed. Nothing difficult, nothing that requires heavy algos to be created, but still (as an example) quite a bit of interaction with datasources to check for data consistency.
So far, we have been using Javascript, but I'm feeling we would hit a wall very shortly since the road to spaghetti code is dangerously close. OTOH, writing our own validators is kind of overkill: as I said before, the current usecases are more convoluted than complex, and in most cases what we need is "chaining" different validation rules rather than write monolithic ones. xReporter's expressions seems to us the next natural choice: writing expressions is easy, yet there is all the power/flexibility of Java under the hood together with the possibility of chaining stuff together. Problem is, though, that we could really use composition in expression lifecycle: atm, specifically, we need to access a Datasource, and we are skeptical about using one of the available internal-only Cocoon hacks (or build our own) to grab a ServiceManager. Now, I reckon that xReporter expressions were designed as simple snippets of easy code, and I sure see the benefits of KISS, but still we could use some cooperation between components inside them. Do you have any handy solution we might have overlooked and/or do you think the (easy to implement) solution could be useful for other CForms users? Are your FS alarms well off-scale already? :-) Ciao, -- Gianugo