1. If you want to become a qualified architect, you must know the concept of software architecture and understand the definition of architecture:
1. Software architecture is a sketch of a system.
2. The objects described by the software architecture are abstract components that directly constitute the system. (Recommended learning: phpstorm)
3. The connection between each component clearly and relatively detailedly describes the communication between the components.
4. In the implementation phase, these abstract components are refined into actual components, such as a specific class or object.
5. In the object-oriented field, the connection between components is usually implemented by interfaces.
2. Architects are subdivided and can basically be divided into three categories:
1. System architect: server load, reliability, scaling, expansion, Database segmentation, caching applications, etc.
2. Application architect: understand the business, sort out models, design patterns, interfaces, data interaction, etc.
3. Business architect: can also be called business domain Experts, industry experts, product consultants, senior consultants. Usually what we call architects is a combination of 1 and 2
Layered architecture is the most common software architecture, and it is also the de facto Standard architecture. If you don't know what architecture to use, use it.
This architecture divides the software into several horizontal layers. Each layer has clear roles and division of labor, and there is no need to know the details of other layers. The layers communicate through interfaces.
Although there is no clear agreement on how many layers the software must be divided into, the four-layer structure is the most common.
Presentation layer (presentation): User interface, responsible for visual and user interaction
Business layer (business): Implement business logic
Persistence layer (persistence): Provide data, SQL statements are placed on this layer
Database: Save data
Some software adds a service layer (service) between the logical layer and the persistence layer to provide different Some common interfaces required by business logic.
The user's request will be processed through these four layers in sequence, and no layer can be skipped.
Advantages
Simple structure, easy to understand and develop
Programmers with different skills can divide the work and be responsible for different layers, which is naturally suitable for most software The company's organizational structure
Each layer can be tested independently, and the interfaces of other layers are solved through simulation
Disadvantages
Once the environment changes, code is required When adjusting or adding functions, it is usually troublesome and time-consuming
Deployment is troublesome. Even if only a small place is modified, the entire software often needs to be redeployed, which is not easy to do continuous release
When software is upgraded, May require the entire service to be suspended
Poor scalability. When user requests increase in large numbers, each layer must be expanded in turn. Since each layer is internally coupled, expansion will be difficult
The above is the detailed content of Why learn software architecture. For more information, please follow other related articles on the PHP Chinese website!