Swift 2 Design Patterns by Unknown

Swift 2 Design Patterns by Unknown

Author:Unknown
Language: eng
Format: epub, mobi
Publisher: Packt Publishing


Well, it doesn't matter what the mobile is; using our appropriate adapter, by default, the charger will send 10 volts, to the adapter, then the adapter will transform this voltage (or not) and call the appropriate charge method on the phone itself.

This concludes the discovery of the adapter pattern.

The facade pattern

The facade pattern is a simple pattern used to group the interfaces of a group of objects and a unified interface that is easier to use by a client.

Roles

The facade pattern allows you to provide the operations that might be desirable by a user. The pattern encapsulates the interface of each object that is considered as a low-level interface. To construct the unified interface, we might need to implement some methods that will compose the low-level interfaces:

It must be used to provide a simple interface of a complex system. The architecture of the system can be composed of several small classes that allow great modularity, but clients don't need such properties. They only need something simple that meets to their needs.

It can be used to divide the system into subsystems. The façade will be an interface that allows the communication between subsystems.

It can be also used to encapsulate the implementation of a system toward an external consumer.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.