This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Business delegate design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Business delegate design pattern" Watch "Business delegate design pattern" New topic

Business delegate design pattern

geet kaur
Ranch Hand

Joined: Sep 03, 2008
Posts: 78
Hey Ranchers!!
I was just going through the design patterns.viz the "business delegate".according to what i understood about it is:

A business delegate hides the complexity of the remote services etc. from the controller.It interacts with the Service Locator for the Remote
Object,Which is a stub,and then calls the methods on this stub.I hope i got it right??

But somwhere i read that it acts as a stub,it implements the remote interface.What exactly is true regarding the business delegate??
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
The primary purpose of the pattern is to reduce the degree of coupling between one or more client objects and one or more objects that provide business functionality, i.e. business objects. The pattern can be implemented on the Presentation-tier or Business-tier.

Aside, "Business Delegate" is the name of a design pattern so both words in the name should be capitalized. Also, the word "I" is always capitalized, not only when it is the first word of a sentence. For example, "When I went to the store I purchased a container of milk."

Vladimir Ozerov

Joined: Sep 27, 2011
Posts: 14
I do not agree with your explanation.
1) Business delegate can only be placed on presentation tier. If we place this code on the business logic tier, than we can name it Facade, Gateway, Adapter and so on (depending on implementation details), but not Business Delegate.
2) The main purpose of this pattern is to decouple the client from stub implementation details and its underlying technology. In this case the client can get rid of handling EJB2.0-specific excpetions, RMI exceptions and so on.
I.e. instead of having the call:
Client -> Client stub (where client stub is tightly coupled to some tehcnology, e.g. EJB, RMI, SOAP, REST, JMX, CORBA, etc.)
... we would have
Client -> Business Delegate -> Client stub
... and the delegate will completely hide the stub from us.
Vladimir Ozerov

Joined: Sep 27, 2011
Posts: 14
A little correction to my previous post:
1) Business delegate can only be placed on presentation tierclient's side.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
There can be client objects that reside on the Business tier. These would be business objects that request services from another business objects. The J2EE Business Delegate pattern applied here as well.

Aside, the term "client object" can refer to more than one concept. Here I'm not referring to "client side" or anything related to the "user" of an application.
I agree. Here's the link:
subject: Business delegate design pattern
Similar Threads
Patterns mock question
Pattern question for gurus
Doubt about Design Pattern
Who should cache stubs - business delegate or service locator?
Questions: The need of Business Delegate?