javen fang wrote:

In your Action where JSP comes from.

In Action get the list from DAO,

I usually throw in one more layer between the Action and the DAO. (Throw whatever groovy Design Pattern name you want at it.. delegate, facade, whatever.. I get them all confused :). Bottom line is I like to call something from the action like...


List list myDelegate.getWhateverList();

myDelegate.updateSomething( Something VO );

Then the myDelegate object can call the DAO. I do this in case there are other business related things I need to also do before or after the actual DAO call. Some exmaples:

Maybe you want a factory to return the correct DAO. Seems more appropriate to abstract this out away from the Action.

Maybe after you do an update some other business rules need to take place... e-mail someone, make some other kind of update to a different table, etc. The Action really should be "Dumb" to all this so it makes sense to do this in another layer.

For a simple app calling the C.R.U.D stuff (create, retreive, update, delete) from a DAO in your action isn't that bad though. I just happen to like the one extra layer.

--
Rick

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



Reply via email to