struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Takhar <sandeep_tak...@yahoo.com>
Subject Re: Representing a 1->m relationship. Any suggestions to the best ap proach?
Date Wed, 02 Jul 2003 19:34:49 GMT
I would suggest getting a copy of Struts in Action and
reading about the Artimus/Scaffold applications.

My experience has been the same as yours.  What we
both want is some type of business delegate pattern. 
Artimus is just that.  You can specify an action and
each action has a business object defined for it.  The
business object will perform an execute.  So now there
are two hierarchy trees - one for accessing business
logic and the other for accepting form input.  More
layers is better.

The other thing to try is that instead of pointing to
the same action, have a different one for Create,
Read, Update, Delete.

sorry if this is a bit general, but I haven't had a
chance to try it yet and there may be some pitfalls...
Hard to imagine how though...

sandeep
--- Shane Mingins
<shane.mingins@assureinternational.com> wrote:
> Hi
> 
> I am struggling with the best approach to take with
> my first Struts
> application and wondered if I could get some voices
> of experience.
> 
> I have a 1->m relationship (Supplier -> Products)
> that I wish to represent
> in a maintenance application.
> 
> You can Add or Edit a Supplier, and then within this
> Add or Edit you can Add
> or Edit Products.
> 
> My persistence layer provides a Supplier Data
> Transfer Object(DTO)
> representing the Supplier->Products (The Supplier
> holds a Collection of
> Product DTO's).
> 
> At the moment I have ActionForm for Supplier held in
> session scope
> containing a collection of Product ActionForms. 
> Depending on Add or Edit
> these are populated from the Supplier DTO.
> 
> When a Save is finally executed I create a Supplier
> DTO and populate it from
> the Supplier ActionForm and collection of Product
> ActionForms.  The DTO is
> passed to the persistence layer.
> 
> I still have logic in the Action classes that I do
> not like, for example the
> Save determines whether to call insert() or update()
> on my persistence
> layer.  I think I need a Workflow type class where a
> method Save() will
> determine whether to call insert() or update().
> 
> So, any comments of my current approach?
> Suggestions for improvements?
> 
> Thanks
> Shane
> 
> Shane Mingins
> Analyst Programmer
> Assure NZ Ltd
> Ph 644 494 2522
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
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