Search code examples
design-patternsfacade

Understanding Facade pattern


I am new to design patterns. I read all I could find about facade pattern.

My understanding is that facade pattern is just a wrapper class that wraps a massive amount of business logic. Is this true?

Is it possible for a method from the facade to do more than one operation?

Can the facade pattern be used within the current assembly?


Solution

  • 1) Facade pattern goal is to simplify doing complex operations by a system or a group of classes. By using facade pattern you can reuse the complex operation call sequence to the target system.

    2) In accordance to SRP, every method even the Facade methods should have a single responsibility. The role of the facade pattern bolds when the target system has fine-grained classes and methods.

    3) Yes