I struggled with the same thoughts. I thought about adding a ScrollableResult interface to my "domain" which can be returned from my queries in my DAOs. Then, I was going to make a Wicket model class that knew how to deal with a ScrollableResult object. That way, I only need to create one wicket/domain adapter class for data table viewing/traversing. There would be a special DAO that knows how to fetch additional rows from the ScrollableResult as well as determine the total number of rows possible. As for single entity models, I would probably create a DetachableEntityModel which knows how to go fetch the entity again when it needs to. Of course, there would need to be a DAO (probably the same one as before) that knows how to go fetch a specific Entity (I have a common interface in my domain model called Entity that all persistent domain entities implement).
On 2/19/08, Bert Radke <[EMAIL PROTECTED]> wrote: > Hi all, > > i 'm evaluating wicket right now with a small project using JPA > (Hibernate) as datalayer. > Together with the "Wicket in Action" (great book so far, thanks), i > could implement > most of the wished features (templating, custom components, ..) but i > 'm kind of stuck > with the proper layering of the application. > > So far, for test purposes, i have some hard wiring in place that i > want to get ride of. > > Most of the application consists of search-forms together with (large) tabular > (read-only) datadisplay. > > Right now, i have some (domain/JPA) model classes, DAO's to access them and > use > Wicket-Spring to inject the DAO's in the web - part. So i use the JPA POJOs in > Wicket to display the data. > > I think of introducing an additional level, 'Wicket-Model' to wrap the > domain-models > into LoadableDetachableModel's. How should they interact with the DAO's? > Should > the Wicket-models directly work with the DAO or should i retrieve the > domain - model > outside (Page / Component) and feed the domain-model object into the > wicket-model? > > How to archive this best for lists of domain-models (ListView)? > > Hacking something together would not be a problem, but i would like to > learn how to > proper layer / separate this in a webapp (current framework i 'm > (forced to) used does > mix it all :( ). > > Thanks in advance for taking the time to read this, > Bert > > PS: apart from Wicket-Spring i 'm not using any extensions right now, > as this is more of > a learning thing right now. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
