What is the difference between facade and business delegate design pattern?
Aren’t both of them used for hiding business logic from the client?
What is the difference between facade and business delegate design pattern? Aren’t both of
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Delegation is standing between the client and the actual implementation, usually hiding/filtering/augmenting certain functionality of the implementation from the client.
Facade is providing a course-grained API hiding more complex logic and/or coordination, usually bundling up several implementations that work together, and usually as a convenience to the client.
Examples of each from java:
Delegation: The
Collections.unmodifiableList()returns a List that keeps a reference to the original List and delegates to it for all methods, but throws Exceptions if its mutator methods are called.Facade: If you’ve ever seen the ridiculous amount of code required to print a java DOM XML document, the first thing you do is create a utility method to hide all the ugliness – that method could be considered a facade.