Subject: Re: Value object doubt !!! From: Vic C <[EMAIL PROTECTED]> === Steel, Toby wrote: > We do things a little differently to avoid code so much duplication > between form bean and value object. There is no data conversion as > a value object is always the vehicle for data delivery. > > The form bean holds a data value object(DVO), and every String field of the > DVO
Similar design. My aproach was FormBean that has a DAO in the example, you have a form bean that has a DVO. > (no validation of input in setter method) is accessed directly on populate > via an accessor to the DVO, getDvo(). > <html:text name="myBean" property="dvo.myTextField"/> The point of MVC is to "hide" the implementation of the model. The presentation view should know nothing about how the form bean is implemented. So maybe a simpler getter. > Any field that does require validating input (integers, dates, postalCodes, > more > complex objects) has a data holder object in the form bean, along with > get/set for the holder. > <html:text name="myBean" property="myHolderField"/> > These holder objects all take string input and have a validate method called > within > the form bean validate method. Do you do client side validation using the Struts validator frame work and regular expersions? Or Server side still using struts-validator.xml? With the simpler getter, Struts could do validation for you. > The form bean's getDvo() method populates the DVO from the holder objects > while setDvo() sets the holder objects from the DVO. > Again very similar at this higher level. I have a populate method that asks DAO to retrieve. You hava a getDVO that : -(OK here we differ:) holder beans that get data from EJBs, and deal with multi rows master detail CRUD and multi row validation? > This works very well, and we can add to our data model without doing > anything > other than adding to the CMP mapping One day someone should tell me how they dealt with CMP issues listed at softwarereality.com becuase I just gave up trying and wasting clients money ( I could have kept billing the client by prologing the pain but that is not what I do) CMP is yet another bean that maybe could be eliminated. Would you do CMP again? I like SQL better than EQL. > and the JSP inputs. [Unless we need to > add > a holder object to the form bean.] > > Result: No translation of beans and value objects, only intermediate help on > those > fields that throw exceptions in their setters or require non-String input. > > > > Toby Steel > > > -----Original Message----- > From: STEVE WILKINSON [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 24, 2002 10:23 AM > To: [EMAIL PROTECTED] > Subject: Re: Value object doubt !!! > > > Given the comments from Craig on not using Value Objects as form beans our > project is taking the following approach. > > We are creating a "helper" class to transform our ValueObject (Data Transfer > > Object as we call it) into a form bean (Strings, Boolean, and boolean types > only) and the reverse.> > >>Radhika Nadkarni wrote: >> >>>hi, >>>Im having an action Form. Im using Value object for data conversions. >>>Now my problem is i have two scenarios for implementing the same : - >>>1) Value object will be separate >>>2) Value object will be composed within the Form Bean. >>>Can anyone tell me which is the best strategy out of the two ? >>> >>>_________________________________________________________________ >>>Get your FREE download of MSN Explorer at >> >>http://explorer.msn.com/intl.asp. >> >>>-- >>>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]> >> > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>