Data Center reconstruction-Layer 7 package diagram, reconstruction of Layer 7 Package Diagram

Source: Internet
Author: User

Data Center reconstruction-Layer 7 package diagram, reconstruction of Layer 7 Package Diagram

The typical three-tier Data Center reconstruction is changed to seven, with the appearance layer, factory layer, and IDAL layer added. The three layers added are the application of the appearance pattern in the design pattern and the abstract factory + reflection for better decoupling and. The appearance layer reduces the Coupling Degree between the U layer and the B layer. In the appearance layer, class and method of the B layer are called and combined to meet the requirements of the U layer, when the demand changes, you only need to change the appearance and B layer, or you only need to change the appearance to meet the demand changes.


The interface defined at the IDAL interface layer is implemented by the DAL layer. In the factory layer, the configuration file is used to determine the database class to which the D-layer link is instantiated, in layer B, factories and interfaces are used to call the link database of layer D. For example

There is a User interface in the IDAL layer, which includes methods for adding and Deleting Users. There are two class inheritance interfaces in layer D. One Class is linked to SQL, and the other is linked to Oracle. These two classes inherit the interface and then implement the methods.

The Factory layer contains statements for reading and writing the configuration file. It is assumed that the configuration file determines that the class to be instantiated is linked to the SQL database in layer D. To change the database, you only need to modify the keywords in the configuration file.

 

Abstract Factory + reflection + configuration file to prevent database replacement. The UML diagram is shown as follows:

When layer B needs to call the method of layer D, it first defines the interface and the factory. When the factory is instantiated, the factory will instantiate the interface implementation class according to the keyword of the configuration file, then it is returned to layer B. layer B is the method of the basic class called when calling the method.

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.