Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Business delegate pattern

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
One of the reasons for going for Business delegate pattern is because the business components is vulnerable to changes.
Suppose if the business component has a method
getAccountInfo( int Accountnumber)
The business delegate pattern may have a method
getAccountInfoFromBusiness(Accountnumber int)
{
return businesscomponent.getAccountInfo(Accountnumber);
}
and the presentation tier components will have code containing invoking to getAccountInfoFromBusiness method.
Now suppose if business component method signature changes then the signature of business delegate class will also change. This turn in requires changes to presentation tier components. I really dont understand why business delegate pattern is needed.
 
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pradeep
as per this site http://developer.java.sun.com/developer/restricted/patterns/BusinessDelegate.html
what is my understanding is that, BD is used to hide the implementation details of accessing business objects.
from the above site:
The Business Delegate hides the underlying implementation details of the business service, such as lookup and access details of the EJB architecture.
If you have BD class then every time you dont have to write code for look up in your servlet OR in jsp.
Correct me if I am wrong
HTH
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ravish,
To quote from the link u pasted
"..Potentially, this reduces the number of changes that must be made to the presentation-tier client code when the business service API or its underlying implementation changes. However, the Business Delegate may still require modification if the underlying business service API changes."
Here is my view - A change in business service API will mean a change in business delegate object. This means that the presentation tier code will also have to change.
Please let me know if I am wrong.
Thanx
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The whole point of the Business Delegate is to hide the changes and continue to present the same interface to the UI.
Let's take your example above. Say the company merges with another which also has account numbers in the same range, so it is decided to change the type of "Account Number" to a String, and prefix all the old ones with an "X", and the new ones with a "Y". We'll also assume that the old UI code is still only interested in the accounts from the old organization. SO we get something like:
The business component now has a method

and the business delegate pattern now has a method

So the Business Delegate has successfully isolated the change from the UI.
[ July 17, 2002: Message edited by: Frank Carver ]
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic