As the scale and complexity of software systems increase, the choice of software architecture becomes more Algorithm The three-tier customer/server architecture provides a good framework for the integration of enterprise resource planning and is the best choice for establishing an enterprise-level management information system. With the development of the architecture, the architecture of the software framework is also evolving. Java technology and. different Solutions of net technology implementation, each of which has its own advantages and disadvantages and is applicable to the requirements of systems of different sizes. This article describes the architecture of the three-tier model based on the implementation of the management information system of China Telecom planned construction, and introduces the Distributed Component Technology of the application system based on the three-tier model, this article describes how to use the J2EE framework to implement the application system.
1. System Structure Selection
1. disadvantages of the traditional two-layer C/S structure
The traditional two-layer client/server model is suitable for running small-scale, few users, and a single database in a secure and fast network environment (such as a LAN. However, as the scale of application systems continues to expand and the complexity increases in the multi-user, multi-database and non-secure network environments (such as the Internet), this two-layer application model will not be able to adapt. In addition, the traditional two-layer structure still has the following defects:
(1) It is a single server with a LAN as the center, so it is difficult to expand to large-scale enterprise wide area network or Intranet;
(2) Limited by suppliers,ProgramThe supplier must re-develop and expand the upgrade and maintenance;
(3) software and hardware combinations and integration capabilities are limited; a fat client is displayed on the software. You must install specific client applications on the client, in addition, the business logic of the enterprise is written in the client application, which makes program maintenance difficult. to upgrade the program, each client needs to install a new client application. At the same time, for the program developer, the reusability of program modules is poor, and each module is relatively independent;
(4) It is difficult to manage a large number of clients in the C/S mode.
Based on the above reasons, the traditional C/S model can no longer meet the needs of development. With the popularization of network technology and the further improvement of user needs, the three-layer Web model emerged.
2. Advantages of layer-3 Web architecture
The three-tier customer/Server mode (hereinafter referred to as the three-tier mode) adds a new level based on the two-tier mode. This mode logically divides the application functions into three layers: Customer display layer, business logic layer, and data layer. The customer display layer is a graphical interface that provides application services for customers and helps users understand and efficiently locate application services. The business logic layer is located between the display layer and the data layer. It provides a clear layer for implementing the business logic of an enterprise. At this layer, it encapsulates the application model associated with the system, and the user presentation layer and databaseCodeSeparated. This layer provides connections between customer applications and data services. The main function is to execute application policies and encapsulate application modes, and present the encapsulated modes to customer applications. The data layer is the lowest layer in the three-tier mode. It is used to define, maintain, access, and update data, manage and satisfy data requests of application services.
The three-tier mode has the following advantages:
① Good flexibility and scalability. When the environment and application conditions change frequently, the application layer can be changed accordingly.
② Sharing. A single application server can provide services for customer applications on different platforms, greatly saving development time and capital investment;
③ Good security. In this structure, the customer application cannot directly access data. The application server can not only control which data is changed and accessed, but also control the data change and access methods.
④ Enhances the repeated availability of enterprise objects. "Enterprise object" refers to the object that encapsulates the enterprise logic program code and can execute specific functions. With the development of component technology, This reusable component model is increasingly accepted by software development.
⑤ The layer-3 mode becomes a "thin client" in the true sense, so as to have high stability, scalability and execution rate.
⑥ In the layer-3 mode, services can be managed together to serve clients in a unified manner, providing good fault tolerance and load balancing capabilities.