You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marco Mistroni <mm...@waersystems.com> on 2004/04/28 11:24:29 UTC
design issue, need comments
Hi all,
I recently had a look at WrapDynaBean from
Commons/beanutils package (it's great, btw!) and made
Me think about my architecture..so I thought that maybe
Some of u can give me some comments on what I m going to explain..
Basically my application is based on N custom DTOs, each different
from
The other, and that fact implies that it's little bit frustrating
writing a factory when new DTOs are added all the time (and I want to
avoid to write a generic factory
Public Object getDTO(String name)
My app is layered so that I have a struts layer which interacts with a
Business delegate layer (which in turn talks to Session façade).
On the struts layer I am using DynaActionForm and
BeanUtils.copyProperties to copy automatically DTOs properties into
DynaActionForm (there are very few 'points' in my code where I need to
know the exact type of the field that I have to access.
So I was wandering, if I use a WrapDynaBean which wraps a custom dto,
then
The struts-layer and business delegate layer will communicate only thru
WrapDynaBean, where nobody has to know details of DTOs (not even struts
layer since I am using DynaActionForm to copy properties, assuming that
it
Will work also for WrapDynaBean)
And at this stage, I can write a single factory for business delegates
which
Returns always a WrapDynaBean
So,
- jsp layer and struts layer interacts using DynaActionForm
- struts layer and business layer interacts using WrapDynaBean
- in the business delegate layer, the proper custom DTO will be
retrieved from the WrapDynaBean
everything looks dynamic :-) ....but I m sure there are drawbacks that
I dont know (because I m using struts since few months and because I m
Sure on the list there are people with more experience that I have that
Can identify the flaws in my design)..
Any comments/hints/suggestions?
Thanx in advance and regards
marco
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org