aspose file tools*
The moose likes Servlets and the fly likes Business Delegate & Value Object patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Business Delegate & Value Object patterns" Watch "Business Delegate & Value Object patterns" New topic
Author

Business Delegate & Value Object patterns

Paul Medford
Ranch Hand

Joined: Aug 28, 2001
Posts: 33
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

Joined: Mar 22, 2000
Posts: 12803
    
    5
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

Joined: Sep 15, 2001
Posts: 55
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

Joined: Aug 28, 2001
Posts: 33
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

Joined: Sep 15, 2001
Posts: 55
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Business Delegate & Value Object patterns