You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bert Radke <ta...@gmail.com> on 2008/02/19 08:57:53 UTC

Layering / Data-access with Wicket

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Layering / Data-access with Wicket

Posted by Bert Radke <ta...@gmail.com>.
Thanks all the the answers, i will dig into the phonebook example and
come back later
with questions. (will be some time, this is a spare time project).

I already used the Blog example for inspirations (got the
Wicket-Spring coupling
from there). Thanks for sharing this.

Bert

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Layering / Data-access with Wicket

Posted by James Carman <ja...@carmanconsulting.com>.
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 <ta...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Layering / Data-access with Wicket

Posted by James Carman <ja...@carmanconsulting.com>.
My implementation is very similar, except the classes aren't
Contact-specific.  They're reusable across all of my entity types.  I
sort of borrowed from that example to begin with. :)


On 2/19/08, Martijn Dashorst <ma...@gmail.com> wrote:
> Take a look at the wicket-phonebook from wicketstuff.org for inspiration.
>
> Martijn
>
> On 2/19/08, Bert Radke <ta...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.1 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Layering / Data-access with Wicket

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
or the blog tutorial, it uses jpa but could be a prettier example...

http://cwiki.apache.org/confluence/display/WICKET/Blog+Tutorial

Martijn Dashorst wrote:
> Take a look at the wicket-phonebook from wicketstuff.org for inspiration.
>
> Martijn
>
> On 2/19/08, Bert Radke <ta...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
>
>   

-- 
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Layering / Data-access with Wicket

Posted by Martijn Dashorst <ma...@gmail.com>.
Take a look at the wicket-phonebook from wicketstuff.org for inspiration.

Martijn

On 2/19/08, Bert Radke <ta...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org