Hi,
A have already understand the idea of the CPM. But i think it is boring
to write another class "just" for handling some properties or beans.
But now i have read "Core J2EE Patterns - Transfer Object[1]" and DTO
can give me more than "just handling some properties or beans". Now i
like Data Transfert Objects and i know why it is good to use it.
Thank you.
[1] :
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
Nino Saturnino Martinez Vazquez Wael a écrit :
Hi Gervais
Im not sure if you have understood the idea of the
CompoundPropertyModel(CPM). You pass a simple domain class to it and
it uses property expressions to retireve what ever requested. For
example if you set a CPM on a page you may add a label using this new
Label("label") this will create a property expression and call the
acesssor getLabel(). If you do not want to expose / keep your domain
class in memory you can chain a CPM and create your own forexample
personModel, and in the scenes behind you could have your big model
and call getPerson on that and keep an id there only for lookup.
regards Nino
Gervais wrote:
Hi wicketers,
I use Wicket since 2 weeks. Before wicket i have worked on many
projects (Swing or Web apps) and try to find the best "architecture".
Now i'm learning Wicket and i have a big problem. I dont'like Data
Transferts Objects.
Many forms use more than one Bean, so i have asked you in a "Getting
Started" mail on how to do that properly.
"James Perry" give me this response :
...
To answer your third qestion on how to bind more then one domain
model
to a form, I would recommend using the Data Transfer Object which has
associations to the domain models you are binding. Then use a
CompoundPropertyModel
to access the associatios.
...
Thank you James. But i don't like the the idea to Create a
DataTransfertObject and give it to a new CompoundPropertyModel. I
think the DTO is like a Model. So i need to create only one Model
that contains all required beans and extends or implements a Model.
What kind of model can i use for doing that in the better and the
cleaner way ?
Thank you