This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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
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.
Joined: Aug 28, 2001
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
Joined: Sep 15, 2001
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!