> 1) form beans generally should consist of String data to facilitate
> round-tripping of invalid inputs. I like to constrain them to a clearly
> defined role of marshaling data 'into' and 'out of' the
> presentation layer,
> i.e. across the boundary between presentation and application.

This i would agree with.  Fields in BO/VOs have various types. ActionForms
should only get/set strings.

>
> 2) value objects should use typed interfaces to ensure marshaling to and
> from presentation format (string types) is pushed as far up the
> application
> stack as possible. This also enables other, potentially type-aware,
> presentation / client tiers to be built on top of the same value objects
> (e.g. for a web-services interface).
>
> To address Micheal's question (why not just make value objects
> and business
> objects the same thing?), I'd point out that it can be valuable to
> distinguish between business rules and application logic. I find my
> business objects often have functionality I don't want called
> directly from
> the presentatin layer, particularly when using a mediation layer between
> the two.
>
> Essentially, though, it comes down to the complexity of the
> problem vs. the
> complexity of the solution. The more complex the application, the more it
> makes sense to partition responsibilities. For very simple
> applications it
> makes sense to collapse layers together.


I tend to merge BO,VO,and DAO all into one bean.  I made a self-persistable
base bean (using OJB), and then just add fields with getters/setters.  All
works nicely.  Add any simple logic into the beans.  Stick complex logic in
managers/helpers/services.  I tend to pass these beans straight up to jsps
for pure displaying of stuff, but then use actionforms to edit/submit data.
A big timesaver can be to write a constructor for an action form that
accepts a BO and fills itself from that.

Daniel.


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

Reply via email to