I, Facade mode structure
External communication with a sub-system must be performed through a unified facade object, which is the facade mode.
As shown in:
In facade mode, only one facade class is required, and this facade class has only one instance. In other words, it is a singleton class. Of course, this does not mean that there is only one portal class in the entire system, but only one portal class for each subsystem.
II, When to use the facade Mode
1Provides a simple interface for a complex Subsystem
2Subsystem independence, introducedFa C AdeThis mode separates a sub-system from its client and other sub-systems, which improves the independence of the sub-system.
3Hierarchical Structure, you can useFa C AdeMode defines the entry for each layer of the system.
3. Facade ModeJavaApplication in
SessionFacade Mode
SessionThe facade mode usesSessionbeanAs a facade, encapsulate the interaction between business objects in a workflow.SessionThe facade object manages Business Objects and provides a coarse-grained service layer for the client. For example: