Object-oriented architecture: three-layer architecture (presentation layer, business layer, and persistence layer)
Three-tier architecture: presentation layer, business layer, and persistence layer.
① Persistence layer: uses the DAO mode to establish object class and database table ing (ORM ing ). That is, which class corresponds to which table and which attribute corresponds to which column. Persistent Layer
The purpose is to convert object data and relational data.
② Business layer: adopts the transaction Script Mode. Encapsulates all operations in a business into a method, and ensures all database update operations in the method.
Failed or both. Avoid data confusion caused by some successful operations.
③ Presentation layer: the MVC mode is used.
M is called a model, that is, an entity class. It is used for data encapsulation and data transmission.
V is a view, that is, a GUI component, used to display data.
C is the control, that is, the event, used for process control.
Design principles:
Design Principle of the business layer interface: one entity class and one interface, one business method submitted at a time. The parameters of the Business Method come from the presentation layer.
Persistence layer interface design principle: an object class, an interface, a persistent Method for one database operation.