Ted,

Thanks for the reply.  I make it a point to keep all of my struts / HTTP
imports in the action, and all of my SQL / DB calls in a separate class
(DAO).  The only thing that my beans should be aware of are the business
attributes that are part of the bean....

Thanks again.

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 12:27 PM
To: Struts Users Mailing List
Subject: Re: [OT - Design] Business Logic and JavaBeans


This is an OK approach to encapsulating related business 'stuff'.

The acid test is whether your business classes import anything from the 
Struts or HTTP packages. So long as this is not the case, then your 
business classes are keeping the presentation tier at arm's length.

Likewise, if your Struts classes aren't importing anything from SQL and 
the like, it's a good indication that you're keeping the system logic 
out of the controller/presentation layer.

-Ted.

Jerry Jalenak wrote:
> I'm considering placing specific business logic methods in the JavaBean
that
> has the business elements used by these methods.  In other words,
something
> like this - 
> 
>       public class User
>       {
>               private String userID;
>               .....
> 
>               public User() {}
> 
>               ... getters / setters for attributes ...
> 
>               public Object validateUserID()
>               {
>                       ... business logic ...
>               }
>       }
> 
> The validateUserID method would call appropriate DAO's, etc. as needed.
My
> struts action would instantiate the bean, then call the validateUserID
> method.  Is this an OK approach to encapsulating related business 'stuff'
> together?  Any obvious problems that I am completely overlooking?
> 
> Thanks!
> 
> Jerry Jalenak
> Team Lead, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Ted Husted,
Struts in Action <http://husted.com/struts/book.html>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to