Java and mode Learning Series-facade Mode

Source: Internet
Author: User

 

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.