struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Duong BaTien <duong.bat...@gmail.com>
Subject Re: Struts Business Logic :: Best Practices
Date Fri, 11 Mar 2005 16:33:48 GMT
Ted Husted wrote:

>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.
>
>  
>
Hello Ted and concerned developers:

I just like to make this piece-meal update on how we use commons-chain 
and hope to get some feedback from gurus out there.

    1) I modify chain CatalogBase and ChainBase to turn CoR Catalog, 
Command, Filter, and Chain into POJO configurable using IoC. This will 
avoid an issue that Vic said about the Rich Client.

    2) Extending the naming approach of Agility, bean references are all 
in names, including the DTO to keep DO and UI objects consistent.

    3) All component services are done with chain Command. I am waiting 
for some "de-facto" standard of having conditional chain. Have you and 
struts committers set down the best way to do it?

BaTien
DBGROUPS

>On Fri, 11 Mar 2005 14:57:51 +0530, karthikeyan balasubramanian
><karthikeyan.struts@gmail.com> 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: 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