Architecture Design Basis
1. What are the aesthetic standards of design? 1) conciseness:
Modular and easy to read and understand.
2) structural consistency (conceptual integrity ):
The Style and modularity of the architecture.
3) robustness (high quality ):
Ease of development, modification, reuse, debugging, and maintenance.
2. known software design methods and techniques (at least 5) And what aesthetic standards they promote (1) Modularization:
The module is divided to hide the implementation details of some program segments (data structures and algorithms), expose the interface and the outside world, and ensure that the internal cohesion of the module is high, and the coupling between the module and the outside world is low. The module hides Implementation Details and accesses the module through interfaces, which promotes simplicity. In addition, the module also provides unified external interfaces, which promotes structural consistency.
2) Information Hiding:
Divides the system into modules. Each module encapsulates an important decision, and only the module knows the implementation details. The decision type can be requirement or change. Different decisions are independent of each other. Information Hiding and modularity both promote simplicity to some extent, but are only reflected in the external interface. Information Hiding segments are separated to deal with decisions that do not require external performance (internal implementation can be modified). To some extent, Information Hiding sacrifices conciseness and achieves robustness.
3) Registration at runtime:
For system changes, you can decouple the parts that may be changed from other parts. Instead of directly calling the program, you can register them at runtime. Because this technology is used for possible changes, things that can be handled by one component are divided into multiple parts, and there are complex interaction rules between these different parts, therefore, simplicity is sacrificed to improve robustness (flexibility)
4) configuration-based programming:
In view of system changes, it mainly solves the problems of commonality and difference. Write the possibly changed part in a configuration file and modify the configuration file directly when the change occurs. Because possible changes need to be fully considered to organize configuration files and the configuration files need to be parsed at system startup, simplicity is sacrificed to improve robustness (flexibility)
5) design mode:
The design model sacrifices conciseness to ensure the maintainability and scalability of the program. At the same time, in the design pattern, the same method is used to do the same thing, so it promotes the achievement of the structure consistency of the program.
3. Hierarchy of Design
The starting point, main concern factors (namely, aesthetic elements), main methods and technologies and final products of high-level design, middle-level design and low-level design
3.1 high-rise Design 1) starting point:
Make up for the deficiencies in the detailed design mechanism, combine a group of modules to form the entire system, design the overall structure, and focus on the quality attributes of the system. Hide import/export relationships and word matching in the detailed design, design component with quality attributes, and link connector ctor between components. At the same time, the architecture is also a series of design decisions for system design.
2) main considerations:
Quality attributes, such as availability, modification, efficiency, security, and testability;
Project environment, including development environment, business environment, technical environment, and business objectives.
In order to achieve the above objectives, the system structure must meet the requirements of simplicity, consistency, and robustness.
3) Main methods and technologies:
1. Methods: 4 + 1 view, scenario-driven, architecture style
2. Technology: The expression method of the module can be box-line and formal language (ADL, Architecture Description language) UML (4 + 1 view Mode Implemented Using UML technology)
4) Final Products:
Architecture Design
3.2 middle-level design 1) starting point:
Divide the modules to hide the implementation details of some program fragments (data structures and algorithms), and expose the interface and the outside world. It can be used repeatedly. Modularization should be as independent as possible. The internal cohesion of the module is high, while the coupling between the module and the outside is low.
2) main considerations:
Simplicity (easy to develop, easy to modify, and easy to reuse), observability (it seems "obviously correct", easy to develop, easy to debug, and easy to maintain ). Objective -- completely independent -- Understanding usage and reuse development and modification
3) Main methods and technologies:
1. Low coupling (minimizing the relationship between modules) and high cohesion (maximizing the relationship between elements in a module)
2. Information Hiding: a module encapsulates only one secret (the main secret is the requirement decision, and the secondary secret is the modification decision), provides the interface for modifying the part, and hides the implementation details of the part to be modified.
3. Combined with modular and Information Hiding Methods, coupled with encapsulation, inheritance, polymorphism and other technologies, object-oriented design
4) Final Products:
Module and Class Structure
3.3 low-Layer Design 1) starting point:
Organize BASIC Language Units (Types and statements) to establish high-quality data structures and algorithms (data structures are reasonable and easy to use, and algorithms are reliable, efficient, and easy to read ). Shielding complex data structures and Algorithm Implementation Details in programs
2) main considerations:
Data structures and algorithms are concise (easy to read) and robust (reliable and easy to maintain ).
3) Main methods and technologies:
Defense programming, Declarative Programming, test-driven development, exception handling, configuration-based programming, table-driven programming, and state machine-based programming. The first four are about reliability, and the last three are about the ease of data structure.
4) Final Products:
Algorithm and data structure, a single function. The source program, middle layer, and bottom layer share detailed design documents.