• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

data transfer from action to biz service

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Experts,

I have a question regarding passing data from action to business service. Please let me know the good practice.

1) Is my assumption correct that the action form (formbean) for the ui layer should be a flat structure like following:


Or it can be in this format too:


Which is a good/recommended practice ?

Note - Edited message to be short and crisp 09/25/2006
[ September 25, 2006: Message edited by: Raj Bhandari ]
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

just to the first part of your question.

no, you are not correct with you assumption. as long as objects follow the bean-convention, you will not have any problems accessing them like this

user.address.street

(which works with a form which has a user who has an adress which has a street, which is a String)

all of them accessible through getters.

i see no reason why you would flatten this structure, this just creates artificial overhead and doubles code.

hope this clearifies,
jan
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I prefer to use flat version for couple of reason

- It's common pratice to use String members in action form
- I don't think having VO's will help if we make very member as String
- If form is big then we will endup with more objects than required.
- What if most of the fields in the forms aren't mandatory?

Is there any real pro's in using hierarchy version? I would be interested in knowing them.
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jan, thanks for the reply.
Also Purushothaman, I agree with you because thats how I used to do but now the form I have to create consists of 100+ fields. So, I'm thinking of using a hierarchial structure so that I can include the BO into the actionform(formbean) directly. This way I won't have to do the mapping also.
Note - I think Jan answered the fact that we can use hierarchial structure within the actionform.. i'm adding another twist (or bad practice ?? i'm asking for a POJO application where we ourselve's maintain the presentation?) by using a BO directly instead.
[ September 26, 2006: Message edited by: Raj Bhandari ]
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic