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 ???
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?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Of course BusinessDelegate only makes sense at all if your business logic *is* remote - which is far from necessary for every system.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
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 ]
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.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Don't get me started about those stupid light bulbs.