struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Mistroni" <mmistr...@waersystems.com>
Subject RE: design issue, need comments
Date Wed, 28 Apr 2004 16:24:34 GMT
Hi,
	True .. I guess eventually I could specify a validation rule
thru validator.xml, or eventually set an initial value to give info to
the user
That it is a numeric field//of the field but I haven\t tried to see what
happens if u define a field as
Integer in DynaActionForm and then you enter a string value..

Thanx 4 pointing that out


Regards
	marco

-----Original Message-----
From: Takhar, Sandeep [mailto:Sandeep.Takhar@CIBC.ca] 
Sent: 28 April 2004 16:20
To: Struts Users Mailing List
Subject: RE: design issue, need comments

If user enters 'a' into a number field, won't this fail during populate
because it is trying to set 'a' into an Integer or BigDecimal field?

sandeep

-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com]
Sent: Wednesday, April 28, 2004 8:23 AM
To: 'Struts Users Mailing List'
Subject: RE: design issue, need comments


Hi,
	With validate/validator method as far as input is concerned..
If then in one field I am expecting a 'proper' value (let's say, I have
A bunch of 'customers' objects, and in the input screen the user enters
A customer that is not valid (it's not one part of the 'bunch'), then
An exception will be raised from the backend..

If u can see any particular case that might cause problem (or that 
I can't deal with either thru the validate() or exception) you're
Welcome to point it out :-)

Thanx 4 the comment and regards
	marco

-----Original Message-----
From: Takhar, Sandeep [mailto:Sandeep.Takhar@CIBC.ca] 
Sent: 28 April 2004 13:01
To: Struts Users Mailing List
Subject: RE: design issue, need comments

How are you going to deal with invalid input since the ui should deal
mostly with strings.

sandeep

-----Original Message-----
From: Marco Mistroni [mailto:mmistroni@waersystems.com]
Sent: Wednesday, April 28, 2004 5:24 AM
To: 'Struts Users Mailing List'
Subject: 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 don't 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

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


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

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


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


Mime
View raw message