struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <maill...@reumann.net>
Subject Re[2]: Is this ok architecture for struts?
Date Tue, 02 Apr 2002 00:08:31 GMT
On Monday, April 1, 2002, 3:57:37 PM, Neil wrote:

NP> I am a newbie.  What is the motivation to having two business objects? 
NP> Is BO-II just a wrapper for use cae specific behavior? or does it have 
NP> all the business logic and leave BO-I as a just the physical DB work?

    Sorry Neil, I guess this long thread lost bits and pieces along
    the way of the original 'problem'. The reason why I'm thinking of
    the business Object II below is because with struts you have these
    great FormBean objects that you create with String parameters so
    when the JSP forms submit the Form bean is automatically
    populated. The problem I'm dealing with is how to handle the
    non-String datatypes, especially when pulling back your collection
    of beans that you populated form a ResultSet. Normally I like to
    have bean member variables represent the appropriate datatype (ie-
    Date, double, whatever ). However, if you just deal with a normal
    bean in this way you then can't use this bean 'as is' using the
    bean tag in the JSP pages since it deals with String members.
    Anyway, I don't repost all the details, but I can comment more
    about it if you aren't sure of the situation I'm trying to best
    resolve.
    
NP> Could this be expressed in EJB terminology?

NP> Rick Reumann wrote:

>> I'm wondering if this a decent design architecture for a non-EJB web
>> application using Struts. I'd appreciate any comments or advice. (Does
>> it break any J2EE principles or not follow any, etc.) For this small
>> example, this architecture is just for wanting to display a list of
>> employees in a JSP page:
>> 
>> BusinessDB Object I
>>     - database query returns ArrayList of EmployeeBean objects (these
>>       EmployeeBean objects have different datatype members other than
>>       String).
>> 
>> Business Object II
>>     - makes call to above Buisness1 Object to get the ArrayList of
>>       EmployeeBeans. Now iterates through this List and makes
>>       a new ArrayList of EmployeeForm objects that have proper String
>>       representations of the EmployeeBean datatypes (ie- birthDate
>>       in 08/11/1969 format, double salary in currency format, etc).
>> 
>> EmployeeAction Object (using EmployeeForm object )
>>     - typical struts action. Makes call to above Business object to get 
>>       ArrayList of EmployeeForm objects and puts them into the request or 
>>       session
>>       
>> JSP
>>     use iterate tag and bean tag to display the EmployeeForm properties
>> 
>>     
>> --
>> 
>> Rick
>> 
>> mailto:maillist@reumann.net
>> 
>> "Any man, in the right situation, is capable of murder. But not any
>> man is capable of being a good camper. So, murder and camping are not
>> as similar as you might think."
>>   -Jack Handey
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>> 
>> 




-- 

Rick
mailto:maillist@reumann.net

"As we were driving, we saw a sign that said 'Watch for Rocks.' Marta
said it should read 'Watch for Pretty Rocks.' I told her she should
write in her suggestion to the highway department, but she started
saying it was a joke - just to get out of writing a simple letter! And
I thought I was lazy!" 
  -Jack Handey


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


Mime
View raw message