• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Business Delegate & Value Object patterns

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What design pattern should be used to enable communication between the JSP code and the enterprise javabeans? Business Delegate & Value Object patterns?
For the Business Delegate: Instead of letting the JSP beans directly access the EJBs, it should access the business delegate for the EJBs.
For a Value Object:
When an enterprise bean uses a value object, the client makes a single remote method invocation to the enterprise bean to request the value object instead of numerous remote method calls to get individual attribute values.
So should we use only one or the other, or both of them chained (in which order)?
Any idea?
Francois
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might take a look at the new book
Core J2EE Patterns - ISBN 0-13-064884-1
for some thoughts on this problem.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've answered your own question:
"For the Business Delegate: Instead of letting the JSP beans directly access the EJBs, it should access the business delegate for the EJBs.
For a Value Object:
When an enterprise bean uses a value object, the client makes a single remote method invocation to the enterprise bean to request the value object instead of numerous remote method calls to get individual attribute values."

The two are very different. The Value Object packages all your data into a single unit that you pass... but you are still accessing the EJB directly. The Business Delegate sits at the presentation tier and interacts with your EJB.
So you can use one, or the other, or both, depending on your situation. If you use both, then basically your jsp will call your Business Delegate, that will pass a Value Object back and forth to the EJBs.
 
Paul Medford
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dave,
That's kind of what I was thinking.
Do you know of any book or site that really talks about how to use all those patterns together to build an enterprise app.
The design pattern books that I looked at describe individually what each pattern does.
At first, I liked Java Design Patterns : A Tutorial 0201485397 because of the Java examples, but the reviews are bad.
Core J2EE Patterns - ISBN 0-13-064884-1
Was recommended and has great reviews, but I don't think it talks about how to combine them together (or maybe it does?).
And there is one that I can't remember its name. It goes through the entire life cycle developing an app using UML, but apparently it does not discuss all the patterns and their combinations.
Any thought?
Thanks,
Francois
 
Dave Soto
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It absolutely does talk about mixing the two together. It is a terrific book, and I would recommend, of course, the Gang of Four book (ISBN: 0201633612) to go along with it. This is NOT an introductory text, but it is required reading material for OO software development. Anyway, good luck!
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic