• 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

Design Patterns

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to one and all,

Can anyone explain me in short n simple way under which circumstances we use Business Delegate, Session Facade and Service Locator design patterns? i have gone through few documents but still haven't got any clarity on these. So please share your words to this thread. Thanks in advance...

Regards
Divya Chowdhary
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll have a better chance of getting a useful response if you ask more specific questions. Also, it helps to QuoteYourSources (←click) when asking questions, especially if your question is related to something you read somewhere. After reading documents about these patterns, what specifically is still not clear to you?
 
divya chowdhary
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:You'll have a better chance of getting a useful response if you ask more specific questions. Also, it helps to QuoteYourSources (←click) when asking questions, especially if your question is related to something you read somewhere. After reading documents about these patterns, what specifically is still not clear to you?



Actually when i was reading about service locator design pattern i came 2 know that there are other design patterns like business delegate and Session Facade. Later i went through the documents to know about them. But i couldn't find any knowledgeable information. That's y i had posted a question in this fashion
 
Ranch Hand
Posts: 88
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Service Locator is usually (at least I have) used to cache JNDI references of EJB Home objects, JMS Connection factories, JMS Queues etc. In other words anything you look up via JNDI can be cached
via a Service Locator pattern. It can be a HashMap or an Hashtable where you will store the references with an appropriate key. The reason this is done is that "JNDI LOOK UP" is an expensive process and ought to be done
only once. In my application this is done when the Application starts in the "init" method of the servlet.

Business Delegate is used when you don't want your clients (Servlets for example) to be directly exposed to business services. These services can either be session beans or POJO's. The reason is that the business
logic api is prone to change often and you don't want your clients to be "tightly coupled" to the services. This pattern is a mediator between clients and the business services. When the services change, you would change
ONLY the business delegate and NOT client code. Also Delegates can cache business data and return results to clients in the event business services are unavailable. One another reason you would use Business Delegates is that you could "STUB" the Business data back to client for testing purposes during initial phases of the project

Session Facade is typically used to "HIDE" a SET of session beans or services that DO a SIMILAR work in an application. For example, in a banking application there can be lot of session beans to handle "Account opening, modification and deletion". You can wrap all these three in an outer "account session facade". This facade will delegate to the appropriate session bean performing the service. Similarly you could have another set of services to handle deposit, withdrawals, overdraft etc. You would wrap these three in another "AccountActivitySessionFacade". Basically facades encapsulate "SIMILAR set of functionalities performed by various business services"
 
divya chowdhary
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Sunderam Goplalan for a wonderful post. It's one of the best post that i have ever read so far... Theoretically i have got complete clarification with your reply...
 
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

divya chowdhary wrote:

Junilu Lacar wrote:You'll have a better chance of getting a useful response if you ask more specific questions. Also, it helps to QuoteYourSources (←click) when asking questions, especially if your question is related to something you read somewhere. After reading documents about these patterns, what specifically is still not clear to you?



Actually when i was reading about service locator design pattern i came 2 know that there are other design patterns like business delegate and Session Facade. Later i went through the documents to know about them. But i couldn't find any knowledgeable information. That's y i had posted a question in this fashion



Please UseRealWords. There's no earthly reason to type "2" when you mean "to", or "y" when you mean "why". These aren't lyrics by Prince.
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic