File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes BusinessDelegate pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "BusinessDelegate pattern" Watch "BusinessDelegate pattern" New topic
Author

BusinessDelegate pattern

Francesco Marchioni
author
Ranch Hand

Joined: Sep 22, 2003
Posts: 190
Hi all scea users,
I have a doubt about the BusinessDelegate pattern.
I have implemented it to search route flights (Prepare Itinerary).
Should I implement with the Service Locator Pattern ? or the BusinessDelegate contacts directly the Service (holding the Lookup Service)?

In the latter scenario the objects in the sequence diagrams are
UserUI---Business Delegate---Segment---Flight

Thanks
Francesco


WildFly 8 Administration Book - JBoss Tutorials
Lars Behnke
Ranch Hand

Joined: May 09, 2006
Posts: 76
I think there is nothing wrong with using the ServiceLocator Pattern in combination with BusinessDelegate. In fact, I did the same.
Francesco Marchioni
author
Ranch Hand

Joined: Sep 22, 2003
Posts: 190
Hi Lars,
thanks for your reply.
So you agree the "prepare itinerary" sequence should be like this:

ClientUI->BusinessDelegate->Service Locator->Segment->Flight

do you agree ?
Thanks
Francesco
Lars Behnke
Ranch Hand

Joined: May 09, 2006
Posts: 76
Hi Francesco,
The ServiceLocator should be independent of any business classes,
for instance:

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: BusinessDelegate pattern