As to business objects, the usual advice is to use Plain Old Java
Objects (POJOs).

The current MailReader example application is an excellent example of
creating a set of interfaces to represent business logic, then
instantiating a set of classes to implement the business logic.

The MailReader uses a Struts PlugIn to create the business logic beans
in application scope. Another good approach is to use Spring to create
your business objects. Here, you might use a PlugIn to create the
Spring instance in application scope, and then call the Spring
instance to create everything else.

Of course, my favorite way to manage business objects now is as a
Chain of Responsbility. But, to get started, you probably want to use
plain old business beans, as the MailReader does.

All this is to say, option 2. The Actions call the business beans, and
the beans do all the heavy lifiting. (Actions shouldn't know *how* to
do things, just who to ask to get things done.)

The iBATIS DAO layer is cool, but if you don't need a switchable DAO,
you can do the same thing using your own interfaces.

Of course, my favorite way to do business logic now is using the Chain
of Responsiblity. But, that's a bit bleeding edge right now :)

-Ted.

On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
<[EMAIL PROTECTED]> wrote:
> Hi all,
> 
>   Struts DB Access Best Practices thread gave me great insight on how
> I should proceed with db operations.
> 
>   I have one more question.  Where do you keep your business logic
> code.  Right now I am thinking to use
> 
> 1. Struts(JSP, Actions)
> 2. Simple class(Managers) to keep all our business logic code
> 3. IBATIS for database abstraction.
> 
> Actions can call Managers to get the job done and Manager can use
> iBATIS to access DB.
> 
> Is this a good approach or is there a better approach than this?
> 
> Looking forward for your response.
> 
> Have a great day.
> 
> Karthikeyan B
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
HTH, Ted.

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

Reply via email to