Results 1 to 4 of 4

Thread: Forms: use domain objects or form beans there?

  1. #1
    Join Date
    Aug 2008
    Posts
    20

    Question Forms: use domain objects or form beans there?

    Hi,

    just a simple design question I am not pretty sure about...

    Do you rather use your domain objects for the form backing objects or do you implement own form beans and push the data through to your domain objects?

    Both approaches seem to fit and have their own advantages, but what is the standard design approach here and why?

    thx & cu

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    There is no real standard design approach. Use what fits best. I used domain objects as well as specialized form objects. As you stated both have there (dis)advantages, just pick the one which suites your needs.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Aug 2008
    Posts
    20

    Default

    Yes thats the way I am doing currently but there must be slight differentiations between both approaches.

    When do you use domain objects and when do form beans suit better.
    e.g.
    -If I am lazy and want to reuse I only use domain objects.
    -If I need some form information for different service methods I create form beans
    -If I use form beans which use a domain object and further data, I delegate data to it and also can use both on the service level

    But what is clean and what is dirty? I don't want to make a design which is "deprecated" like the XML controller configuration and must be changed soon ;-)

    I also want to try annotation based validation with At-Length and At-NotBlank and so on. This technique seems very well for form beans but should also work for domain objects.
    If I use it for domain objects I will blow up my domain objects with a lot of annotations.

    So far thank you :-)

  4. #4
    Join Date
    May 2008
    Location
    Haddonfield, NJ 08033
    Posts
    46

    Default

    How many new projects are using Struts 1 these days? Ask someone what they think of ActionForms.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •