Overall design task
Determine the architecture of a reasonable software system based on the logic model of the target system obtained in the user requirement analysis phase. it includes dividing the modules that constitute the system, calling relationships between modules, interface relationships between modules, data structures or database structures used by the software system.
Software structure and process
The software structure represents the relationship between software elements (modules), and the relationship between software elements is diverse, such as call, inclusion, subordination, and nesting, these links can all be expressed as layers. hierarchical structure is a form of representation widely used in software structures. Because of its clear and understandable structure, it improves reliability, maintainability, and readability. the hierarchy of modules as software elements is a static hierarchy, which is obtained in the step-by-step definition of "problems, when every part of the problem can be implemented by the module, the hierarchy of the software will be obtained. the problem definition process is actually a decomposition process that implicitly represents the relationship between modules.
The software structure provides the relationship between software modules. The software process describes the operation details of each module, including the operation details of a module on the next layer. in fact, the process description is a detailed description of a module algorithm.
Module Design
There are several main concepts in the module design ,:
I will introduce these concepts to you below
Modular
In the process of software development, large software involves a wide range of control paths and a large number of variables. modularization aims to enable a complex large program to be managed by human intelligence. The ideal module has the following features:
- Each ideal module only solves one problem.
- The functions of each ideal module should be clear and easy to understand.
- The ideal connection between modules is simple and independent.
- A system composed of ideal modules is easy to understand, easy to program, easy to test, easy to modify and maintain.
Abstraction
In object orientation, objects are an abstraction, and structured analysis methods also involve abstraction. abstract is a way of thinking. In module design, abstract methods refer to ignoring the details of things and understanding things through the common characteristics of things. each step of software engineering is a refined abstraction layer of software solutions. in the feasibility analysis phase, the software is regarded as a complete system part. During the requirement analysis period, the software is described using familiar terms in the Problem Environment; from the overall design stage to the detailed design stage, the degree of abstraction is further reduced. Finally, when the source program is written, it reaches the bottom layer of abstraction.
Information Hiding
Information Hiding refers to the information (process and data) contained in a module when designing and determining a module ), other modules that do not need this information are inaccessible or invisible. information Hiding is of great benefit to software testing and maintenance. in this way, during the modification period, the impact of errors introduced due to negligence can be limited to one active module without affecting other parts of the software.
Module independence
Module independence means that each module in the software system only involves specific sub-functions required by the software, while other module interfaces in the software system are simple. the degree of independence of a module can be measured by two qualitative standards, namely coupling and cohesion. coupling is used to measure the closeness of the dependencies (connections) between different modules. Cohesion is used to measure the closeness of each element in a module.
Module coupling
Coupling is a measure of the degree of interconnection between modules in a software structure. the coupling strength depends on the complexity of Inter-module interfaces, the method of calling modules, and information through interfaces. loose coupling systems should be used as much as possible in software design. in such a system, you can study, test or maintain any module, without having to have a lot of understanding and influence on other modules of the system. the criteria for distinguishing the degree of coupling between modules are:
We should adopt the following principle: Try to use data coupling, use less control coupling, limit the scope of public environment coupling, and do not need content coupling at all.
Module cohesion
The module cohesion refers to the closeness of each element in a module, and the combination strength of the processing actions. The design should strive to achieve high cohesion. cohesion and coupling are closely related. High Cohesion of modules usually means loose coupling between modules. cohesion and coupling are powerful tools for modular design. the criteria for distinguishing the degree of cohesion of a module are as follows:
All in all,Modular,Abstraction,The direct result of the concept of information hiding and localization is that the module is independent.,High Cohesion and low coupling can achieve high module independence.
Structure Design
The software architecture can also have multiple forms and styles, such:
- Pipelines and filters
- Object-oriented
- Implicit request
- Hierarchical
- Process Control
When designing a software, an important factor in selecting a design style is to analyze the scope of the software application. Each design style has its own strengths. We should select it based on the specific application.
General Design Principles
- Diversified Design
- The design should be traceable for the analysis model.
- Design should not start from scratch
- Software design should minimize the distance between software and the real world
- Design should be consistent and normative
- Ease of Modification
- Fault Tolerance Design
- Proper design granularity
- The quality of the software should be evaluated during design.
- Review design to reduce design errors