facade | has definition A pattern in which you create a class that provides a simplified interface to a package | |
has context html>- Often, an application contains several complex packages.
- A programmer working with such packages has to manipulate many different classes
| |
has forces html>- It is hard for a programmer to understand and use an entire subsystem - in particular, to determine which methods are public.
- If several different application classes call methods of the complex package, then any modifications made to the package will necessitate a complete review of all these classes.
| |
has problem How do you simplify the view that programmers have of a complex package? | |
has references one of the Gang of Four patterns. | |
has solution - Create a special class, called a «Facade», which will simplify the use of the package.
- The «Facade» will contain a simplified set of public methods such that most other subsystems do not need to access the other classes in the package.
- The net result is that the package as a whole is easier to use and has a reduced number of dependencies with other packages.
- Any change made to the package should only necessitate a redesign of the «Facade»class.
| |
is a subtopic of 6.9 - The Facade Pattern | |
is an instance of design pattern | |
design pattern | has antipatterns zero or more antipatterns - solutions that are inferior or do not work in this context with the reason for their rejection | |
has name | |
has related patterns zero or more related design patterns | |
should be illustrated using a simple diagram | |
should be written using a narrative writing style | |
pattern | should be as general as possible | |
should be described in an easy-to-understand form so that people can determine when and how to use it | |
should contain a solution that has been proven to effectively solve the problem in the indicated context | |