• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business Delegate & Value Object patterns

 
Paul Medford
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Dave Soto
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic