Re: ThrowawayBean2+DAO Best Practices

Michael McGrady <[email protected]> Wed, 05 Nov 2003 15:22:34 -0800
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
I was wondering, Ted, how you measure Maverick against "the 
competition"?  Your view on these things is respected, of course.

At 01:26 PM 11/5/2003, you wrote:
>[email protected] wrote:
> > Could anybody show me how to use DAO Factory + DAO + ThrowawayBean2. I
> > don't know if DAO implementation itself could be a singleton and what
> > are best practices.
>
>Typically, a DAO configuration is exposed as a singleton that you might 
>access like this:
>
>         AccountDao dao = DaoConfig.getInstance().getAccountDao();
>         List list = dao.listByUserName(this.getUserName());
>
>If you were using a ThrowawayBean2, then your subclass would include 
>whatever properties the DAO signature required (shown as 
>this.getUserName() here). If the signature took a property bean, then 
>ThrowawayBean2 might implement the appropriate interface, so you'd have 
>something like:
>
>         AccountDao dao = DaoConfig.getInstance().getAccountDao();
>         int value = dao.storeAccount(this);
>
>iBATIS includes a very nice DAO framework that works with any persistance 
>strategy, including their own very fine SqlMap framework. Highly recommended.
>
>The iBATIS JPetstore3 application is a full-blown example of using iBATIS 
>with Struts. Essentially, the ThrowawayBean3 combines the utility of the 
>ActionForm and Actoin into one handy class.
>
>I'm planning to do a version of JPetstore3 using Maverick, but that might 
>be some time coming.
>
>HTH, Ted.
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>Does SourceForge.net help you be more productive?  Does it
>help you create better code?   SHARE THE LOVE, and help us help
>YOU!  Click Here: http://sourceforge.net/donate/
>[INVALID FOOTER]
>



LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
[INVALID FOOTER]