• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java application need to use ServiceLocator?

 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

When a java app is interacting directly with the EJB container is the ServiceLocator used as it is when the web container communicates with the EJB container?

Thanks in advance. : )
 
Marcelo Camilo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pete,

Is this an architect issue? The project's instructions and the architect duties listed on the Mark Cade and Simon Roberts Architect Study Guide say to you keep focus on the system's architecture, not implementation details.

Let this "stress" to programmers. :-))))))))
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at Cade's component diagrams you'll note he uses a ServiceLocator.
 
Harish Ramchandani
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,

Yes. The Java client application should use "Business Delegate" pattern, that in turn uses "Service Locator" pattern, to access the business services provided by EJB Tier.

Hope this helps.

- Harish
http://www.harishramchandani.com
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harish,

Thanks for the reply!

Are you aware of any examples of this desgin concept implemented anywhere so I can review? Or should I just assume the business delegate is embedded in the java application and not worry about representing it in a component diagram?

Peter
[ June 19, 2004: Message edited by: PETER BERGOFF ]
 
Harish Ramchandani
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,

You MUST have a "Business Delegate" component in your Component Diagram. You should also show a "Service Locator" component with the depedancy relationship with Business Delegate Component.

The best place to look for is Sun's Pet Store application design. Also, you might want to glace through Business Delegate J2EE design pattern. Here is the URL
http://java.sun.com/blueprints/patterns/BusinessDelegate.html

I think this will answer most of your questions. If you still have any questions, post it to this thread only or send me an email at harish@harishramchandani.com

Cheers !!
- Harish

http://www.harishramchandani.com
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Harish,

Very good link.

My concern now is that the web tier owns the business delegate object but the java app will be going directly to the app server and not through the web tier. So do I need to add another business delegate to again go on to the app server tier?

Thanks again for your insights!
 
Kay Badri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some one replied this question with the following answer!
"The entire process of accessing the FFMS web server should be performed via a Stateless EJB. That will make it easy for both types of clients to access the FFMS data.

Customer Web Client
-------------------
Web Browser -> Servlet -> Business Delegate -> SSB -> DAO -> HttpConnection -> CGI/Perl FFMS Web Server

Travel Agen Client (Swing App)
------------------------------
Swing Client -> Business Delegate -> SSB -> DAO -> HttpConnection -> CGI/Perl FFMS Web Server"
 
Peter Bergoff
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kay,

That's my thought on the process too. However, in the client app scenario where is the business delegate? Is it "inside" the client app?
 
Ramon Gill
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
You're right - it would be on the client.
Ray
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic