struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pilgrim, Peter" <peter.pilg...@csfb.com>
Subject RE: Theoretical debate
Date Fri, 18 Jun 2004 17:11:31 GMT

> -----Original Message-----
> From: mike [mailto:mike@michaelmcgrady.com]
> Sent: 18 June 2004 15:31
> To: Struts Users Mailing List; user@struts.apache.org
> Subject: Re: Theoretical debate
> 
> 
> At 07:18 AM 6/18/2004, Bill Schneider wrote:
> 
> >Form beans can be thought of as a special case of DTOs: they are the 
> >argument the client (web browser) passes to the remote 
> method call (HTTP 
> >POST).  So passing form beans directly to business logic is _almost_ 
> >reasonable, putting the dependency issue aside for now (form 
> beans have to 
> >extend ActionForm).
> >
> >The difference is, form beans are a model of the /user 
> input/, and since 
> >there may be invalid inputs (for example: "asdfjkjkd" in a 
> field that's 
> >supposed to be numeric) form bean fields often need to be 
> Strings when the 
> >corresponding field in a "real" DTO would be a Date or Integer.
> >
> >To deal with this, I've used a tool called XSnapshot (just 
> released to 
> >SourceForge: http://xsnapshot.sourceforge.net) to generate 
> form beans and 
> >other DTOs from XDoclet tags in a POJO data model.  That way you get 
> >_both_ real DTOs and Form Beans without writing all the 
> classes by hand, 
> >and you can copy between DTOs and form beans with 
> BeanUtils.copyProperties.
> >
> >-- Bill
> >--
> >Bill Schneider
> >Chief Architect
> 
> I don't think we should be thinking of action forms as DTOs.  
> DTOs or VOs 
> have a special use and a special problem that they are meant to 
> solve.  Action forms are related to an entirely different set 
> of issues 
> about data farming.  I don't think we can put the dependency issue 
> aside.  That is really the whole point of frameworks like 
> Struts.  If you 
> can put the dependency issues aside, you probably don't need 
> Struts.  If 
> you don't need a hammer, that is not a critique of a hammer.  
> Likewise, 
> Struts has an objective and, with clear areas that could be 
> improved, does 
> that really well.  There is a good reason that Struts is so 
> successful.  Craig is a sweetheart, but that is not the 
> reason for the 
> success of Struts.
> 
> I think that a lot of the problems people have with 
> repetitive programming 
> is not the fault of the framework but the failure to use 
> coding techniques 
> that are readily available, such as dynamic proxies.
> 
> Michael
> 
> 

Yes I could not agree more. This why Commons BeanUtils 
and PropertyUtils was invented. It sound like people
have an itch for a mapping properties that converts
ActionForm (Dyna also) to a Value Object. Convert me X into Y whilst
copying the attributes as best I can from X to Y.
Sounds like a very old OO problem: Morphing Eclispe into 
Round Rectangle into a Triangle. I wonder.


--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston, 
10 South Colonnade, London E14 4QJ, United Kingdom
Tel: +44 (0)207 883 4447

==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================


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


Mime
View raw message