struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erez Efrati <er...@netmedia.net.il>
Subject RE: value objects and forms
Date Mon, 19 May 2003 18:01:10 GMT
Hi,

Having read what you already had written, I wanted to say also, that in
my project, my forms are just wrappers to value objects (or DTOs), and
it works very nice. 

For instance, if I have a User entity, I also keep a UserDTO, and all
the registration form is just a wrapper holding both UserDTO, and other
DTO required.
One limitation is that in the JSP files the tags has the nested
structure planted - for instance <html:text property="user.username">
and in my RegForm I have get/setUser() { return m_userDTO; } 
Therefore, every movement of fields from one DTO to the other requires a
change in the JSP files dealing with these fields. On the other hand,
these DTO or VO are handled by the session fa├žade, and can be used by
other presentation/logical layers other than the web. 

-- Erez

-----Original Message-----
From: Erik Price [mailto:eprice@ptc.com] 
Sent: Monday, May 19, 2003 6:45 PM
To: Struts Users Mailing List
Subject: Re: value objects and forms



florian wrote:

> basically i wonder what speaks against this:
> 
> having a formbean with a instance of the vo. all the getter and setter

> calls are delegated to
> the getter and setter methods in the vo.
> 
> this would allow the vo to be populated automatically and the formbean

> would be just a
> wrapper around it..

Good question.  I don't see anything wrong with it, I'd be interested in

hearing others' opinions to learn from.

> the only thing i wonder about: is it allowed to to have getter and 
> setters which dont map
> directly a field of the object? does this violate the javabean spec?

No, you can have bean properties that do not correspond to actual
fields.



Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message