On 6/10/05, Werner Punz <[EMAIL PROTECTED]> wrote: > Craig McClanahan wrote: > > > > > I'd be happy to assist, but won't have time to do the whole thing. > > Maybe I can do a starter for one or two components as an example, and > > let you guys hammer out the rest of them. > > > Craig since you are here reading this, I have a question you might be > able to answer me best. > I have written a Hibernate Datamodel in the past, I am not totally happy > with it. > The problem is following: > The Datamodel follows the approach you guys layed out in the JSF specs > of first giving back the total number of datasets and then sending row > by row. > > The main problem I have with this approach is, that I cannot see a > clear demarkation line between start of request and end of request, > which would be needed in many cases to get a decent session and > transaction and and paging in place. > > The only way I could see a way out would be over phase listeners which > sort of could trigger the datamodels at the beginning and and of the > phases, so that at the beginning the transaction or whatever you have > could be opened, or even the full page could be read, then the usual > mechanisms could trigger for and at the end of the request cycle the > whatever cleanup which is needed could be done. > Which means some kind of inter application event system (doable, but messy) > > Just my question to Craig, or whoever might be able to answer me this, > is there a better way to do this, without having to delegate such a task > to a phase listener (I am not totally happy about this approach) > I must have missed some clear demarkation point the last time I checked > out the code (I must admit also I was learning JSF back then) > >
Solving these sorts of problems is exactly what the Shale framework (part of the Struts project) is designed to address. Current starting point for info is on the wiki (i'm working up the docs for the website). http://wiki.apache.org/struts/StrutsShale You'll be interested particularly in the ViewController interface, and the fact that it gives you event callbacks at the beginning and end of a view (init and destroy) and well as other events dependent upon whether you are processing a form submit or not (preprocess and prerender). Shale presumes that JSF exists, and leverages its front controller framework rather than treating JSF just as a mechanism for constructing the view. Craig