• 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

Doubt about Command and BussinesDelegate

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application and use Command Pattern with action and facade pattern. Is best practise to use a bussinessDelegate to access to facade, or if use command & action not is necessary use bussinesDelegate ???
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see BusinessDelegate as a convenience for the client. It's easier to call a POJO delegate than it is to manipulate all the remote protocol. If that's all it is, you'd decide whether or not to use it just by whether or not you'd like to make life easier for the client coders. Do you see it adding a different value than that?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course BusinessDelegate only makes sense at all if your business logic *is* remote - which is far from necessary for every system.
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Business Delegate is not just for convenience for the client programmer but
- allows to provide a robust kind of proxy
- - written by the server (or common) developer team
- - thereby automatically matching the Session Facade's interface (maybe not too important when using Commands)
- - but running within the client JVM and
- - used by the client code / client developers,
- allows centralizing and caching handles(!) to EJBs (Session Bean, your Session Facade) to reduce the time consuming JNDI lookups to just once.
- allows best decoupling.

Imagine spending your hollidays in a foreign country. If you need to contact an office of your home country, you delegate your request (Command) to your embassy in that foreign country. The embassador (Delegate) works within that foreign country but still on behalf of your home country that makes the laws, fees, help (server-side business logic) and all that your country provides in its service (Facade) for embassies.
Thomas.
[ August 18, 2005: Message edited by: Thomas Taeger ]
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was stuck for the moment thinking of separate client and server teams or coders. At the time I was thinking about providing new public interfaces to a bunch of other folks. You're right, the delegate does some nice things like caching and error handling and reducing coupling even if the client & server coders are the same person.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic