struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Duffy <mduffy_li...@yahoo.com>
Subject RE: Theoretical debate
Date Sat, 19 Jun 2004 13:13:34 GMT
Thanks for a very interesting thread.

An elucidation of many of the topics in this thread can be found in Ted Husted's book, Struts
in
Action; especially see chapter 5, Coping with Action Forms.

It is very tempting when you first come to Struts to do a great deal of processing in the
Action
classes, especially if the application is "simple".  However, this approach is not optimal
for the
long term.

We try to keep our Action classes as thin as possible. The Action classes are used primarily
as
controllers; business logic processing takes place in worker classes or factory classes. Also,
we
use our business model classes simply as data transfer objects to pass data between different
components of the system. This is contrary to pure object-oriented design (i.e., objects have
both
state and behavior); however, this approach leads to a more modular and extensible system
(many
components can act on the same business model data).

There have been other threads in this newsgroup discussing the pros and cons of Struts vs
JSF. 
There is definitely overlap in the two frameworks with JSF going beyond Struts to create a
component model that can be applied to the web.  

In my judgment, the promise of JSF will be realized when advanced tools greatly simply the
process
of creating applications.  The "Sun Java Studio Creator"
(http://wwws.sun.com/software/products/jscreator/), formerly known as "Project Rave", will
be
worth evaluating.  Actually, if Sun gets this right, it will be incredibly cool.

If we knew the "inside game" at Sun, I think the story would be that they decided to develop
a
system to compete against the MS Visual Studio tools, and in making that decision they realized
they needed a robust, extensible framework. JSF is being created for the "Sun Java Studio
Creator".  Hopefully, this will be good for us all. 

Mike


--- "Pilgrim, Peter" <peter.pilgrim@csfb.com> wrote:
> 
> > -----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
> 
> 


		
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message