Subject: Re: FormBeans, Data Beans and Databases (oh my)
From: Vic Cekvenich <[EMAIL PROTECTED]>
===
Very close, almost good enough:
Create a DAO bean (that would do your dbConnect, retreive, update, etc.)
aanything persistance specific.
Create a BaseFormBean, that has a DAOBean property. It would call
myDAO.retrieve(), myDAO.update(), etc. and have getters and setters( Ex.
MyDAO.updateString("X","Y");)
Sample code on homepage of baseBeans.com.
Justin Harvey wrote:
> Good morning folks (or good afternoon, evening):
>
> I wanted to ask a couple questions and bounce an idea off you guys.
>
> The first is I've been taking my data models and making beans out of
> them as I should ya? So a user in my "portal" let's call has a UserBean
> with get() set() methods for each of the properties. But for for
> registering a user, struts requires a FormBean. So I've repurposed the
> same data model bean and made it a form bean. Is this good or bad?
>
> Secondly, my beans not only double as data models and formbeans but they
> also have a method which returns a preparedstatement on how to render
> the bean as a SQL insert statement. Is this good or bad? What better
> way to be able to translate the bean into the database =).
>
> Are these good ideas or bad ideas?
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>