Home > Articles > Software Development & Management

  • Print
  • + Share This
This chapter is from the book

Review Questions

Observations

  1. Define Facade.

  2. What is the intent of the Facade pattern?

  3. What are the consequences of the Facade pattern? Give an example.

  4. In the Facade pattern, how do clients work with subsystems?

  5. Does the Facade pattern usually give you access to the entire system?

Interpretations

  1. The Gang of Four says that the intent of the Facade pattern is to "provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use."

    • What does this mean?

    • Give an example.

  2. Here is an example of a Facade that comes from outside of software: Pumps at gasoline stations in the United States can be very complex. There are many options on them: how to pay, the type of gas to use, watch an advertisement. One way to get a unified interface to the gas pump is to use a human gas attendant. Some states even require this.

  3. What is another example from real life that illustrates a Facade?

Opinions and Applications

  1. If you need to add functionality beyond what the system provides, can you still use the Facade pattern?

  2. What is a reason for encapsulating an entire system using the Facade pattern?

  3. Is there a case for writing a new system rather than encapsulating the old system with Facade? What is it?

  4. Why do you think the Gang of Four call this pattern Facade? Is it an appropriate name for what it is doing? Why or why not?


Footnote

1. Gamma, E., Helm, R., Johnson, R., Vlissides, J., Design Patterns: Elements of Reusable Object-Oriented Software, Boston: Addison-Wesley, 1995, p. 185.


 

  • + Share This
  • 🔖 Save To Your Account