This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to put the Business Delegate?

 
Shouton Eulle
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many SECAs told us their success stories that they have applied the BussinessDelegate design pattern in their solutions.
I decided to follow the proven practices. However, I am so confused how and where to put the BussinessDelegate in the component diagram.

According to BusinessDelegate( http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html), this design pattern is a business service. Therefore, it sounds should be located in EJB tire. However, it is the class that should be together with SeviceLocater, and must be deployed on Web Server.

Here, is my question
1) Where to put my BusinessDelegate, in Web tire (E450), or EJB tire(E10000)?
2) If I deployed it on the web server, is it possible to make swing application to invoke it?
Swing application can access a seissionFacade directly, however, use a RMI to invoke a bussinessDelegate which located on E450� offcorse, it is not impossible, but is the solution really makes sense?

Thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11833
181
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shouton,

Instead of trying to force a particular pattern into your solution, I recommend you work on individual sections of your solution and work out what patterns will work. You might also review your solution at the end of the assignment and see if you can spot more patterns.

There is a risk, in the way you have phrased your question, that someone may give you a 'put this pattern here' type of answer, and you will have learnt nothing from it.

Later if someone were to ask you why you used a business delegate, you would be unable to answer them (possibly causing you to fail the exam).

Or (even worse in my perspective), if you were to get a job as an architect, and you suggested using a Business Delegate in an inappropriate place, or you failed to spot where a Business Delegate should be used, then those around you would consider the SCEA certification useless.

My challenge to everyone reading this post - this is an excellent learning / teaching opportunity. We can discuss the Business Delegate design pattern without going into the specifics of how it fits into the assignment (which, as mentioned in the SCEA FAQ is not allowed in this forum). And at some point there will be an "ah-ha" moment, where everything falls into place and we will all benefit.

Regards, Andrew
 
Frank Kuepper
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shoutun,

I think, you are confusing component and deployment diagrams.

A component diagram doesn't consider tiers and nodes. Therefore the business delegate can be referenced from all client componentes, that need it (for example web-interface components and swing-interface components).

As for the deployment to the different tiers and nodes, a component can be deployed to more than one tier/node. Therefore it is possible to deploy and use the business delegate in the web-tier as well as in a swing client applicaion.

As for the pattern definition: business delegate is regarded a business service as it acts as a proxy for the server side business object hiding the complexities of lookup and remote invocation. So it normally is implemented by the business component developer for use by the client components. Of course it has to be deployed alongside with any client-component, that uses it.

Hope that helps (and hope to have provided a bit of the learning experience mentioned by Andrew instead of a "put it there" )
Frank
[ July 06, 2007: Message edited by: Frank Kuepper ]
 
Shouton Eulle
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Frank

thanks. your kindly answer is really helpful.
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an excerpt from "Core J2EE Patterns":

Business delegates are plain Java objects that are local to the client. Typically, business delegates are developed by the EJB developers and provided to the client developers.


Diagrams in Core J2EE Patterns clearly shows that Business Delegates are at presentation tier.

Hope this clears up the confusion.
[ July 10, 2007: Message edited by: Hafizur Rahman ]
 
Devender Thareja
Ranch Hand
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hafizur Rahman:
Here is an excerpt from "Core J2EE Patterns":



Diagrams in Core J2EE Patterns clearly shows that Business Delegates are at presentation tier.

Hope this clears up the confusion.

[ July 10, 2007: Message edited by: Hafizur Rahman ]

Actually It has thickened up the confusion.
The EJB developer develops it but it resides on client side? Are you talking about ejb stubs (remote interface) object?
It has to be more general then that. Experts please comment.
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please have a look for example here
http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints/admin/web/AdminRequestBD.java.html
 
Devender Thareja
Ranch Hand
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the example Hafizur.
I don't see why such class should be developed by EJB developer. I think use of business delegate to encapsulate the access to EJB is very much client layer architecture issue and should be done by client side groups.
This is a good example of how business delegate are used but this is not the only situation when you use a business delegate. It can be used to access any non-ejb system or to provide a functionality common to all use cases. That's how I feel.

Originally posted by Hafizur Rahman:
Please have a look for example here
http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints/admin/web/AdminRequestBD.java.html
 
Ben Two
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, As an experienced server-side developer I don't agree that the Business Delegate should be developed by client developer. Since EJB or other server side component like RMI,Web Service,COM, EJB are all components which means it should be easily assembled and used, which means it'll be better to supply a component with easy usage that the client can invoke it as well as local objects.

So, for me, I'll develop the EJBs and also Service Locator, Business Delegate and finally deploy to two jars, one contains EJB objects which will be deployed to application server, the other will contain Business Delegate along , ServiceLocator with EJB home and remote interface classes which will de deployed to client layer.

kind regards
Ben
 
sammaiah kyatham
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Ben,
You are right. It is a presentation layer/client layer design pattern.
Client developer doesn't know how to access the business methods from Server components. Business delegate helps them to access the business methods easily with out any server side components knowledge.


Thnx,
Sam
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though this topic is not discussed for long, recently I got some clarification about Business Delegate.

Though BD resides on Web/Client tier, this is actually a Business tier component. That's why they are generally provided by the component developer.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic