Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The purpose of software architecture design

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

To put it simply, the purpose of software architecture design is to decompose the software system and reduce the complexity of software system development on the premise of maintaining the internal relationship of the software, while the basic method of decomposing the software system is nothing but layering and segmentation. However, on the premise of maintaining the internal relationship of the software, it is not an easy task to divide the system into layers and what granularity it can be divided into. There are various decomposition methods in this aspect, such as: separation of concerns, aspect-oriented, object-oriented, interface-oriented, service-oriented, dependency injection, and various design principles.

The coupling can be divided into the following types, and the degree of coupling between them is arranged as follows:

(1) content coupling: if one module accesses the content of another module directly, the two modules are called content coupling.

Content coupling occurs between the two modules if one of the following occurs in the program:

1. One module directly accesses the internal data of another module.

two。 One module is transferred directly to the interior of another module without going through the normal entrance.

3. Part of the code of the two modules overlaps (this part of the code has certain independent functions).

4. A module has multiple entrances.

Content coupling may occur in assembly language. Most high-level languages have been designed not to allow content coupling. The coupling of this kind of coupling is the strongest and the module independence is the weakest.

(2) Common coupling: a group of modules access the same global data structure, which is called common coupling. The common data environment can be a global data structure, a shared communication area, a common coverage area of memory, and so on. If the module only inputs data into the public data environment, or only takes data from the public data environment, this is a relatively loose public coupling; if the module not only inputs data into the public data environment, but also fetches data from the public data environment, this is a tighter public coupling.

Common coupling can cause the following problems:

1. It is unable to control the access of each module to public data, which seriously affects the reliability and adaptability of the software module.

two。 Make the maintainability of the software worse. If a module modifies the common data, it will affect the relevant modules.

3. It reduces the understandability of the software. It is not easy to clearly know which data is shared by which modules, and it is difficult to troubleshoot.

In general, common coupling is used only when there is a lot of data shared between modules and it is inconvenient to pass through parameters.

(3) external coupling: a group of modules access the same global simple variable, and do not transfer the information of the global variable through the parameter table, it is called external coupling.

(4) Control coupling: the transmission between modules is not data information, but control information such as flags, switches, etc., one module controls the function of the other module.

(5) tag coupling: transfer data structures rather than simple data between the calling module and the called module, also known as feature coupling. The data passed between the modules of the table and the table are not simple variables, but data results such as data names, record names, and file names in high-level languages. These names are tags, but actually pass addresses.

(6) data coupling: only simple data item parameters are transferred between the calling module and the called module. Is equivalent to value passing in a high-level language.

(7) indirect coupling: there is no direct relationship between the two modules, and the relationship between them is realized entirely through the control and invocation of the main module. The degree of coupling is the weakest and the module independence is the strongest.

Conclusion: coupling is an important factor affecting software complexity and design quality. in order to improve the independence of modules, we should establish a system as loose as possible between modules. We should adopt the following principles in design: if there must be coupling between modules, data coupling should be used as much as possible, less control coupling should be used, public coupling should be used cautiously or controlled, and the scope of public coupling should be limited to avoid content coupling as far as possible.

Ziyun (Shenzhen) Software Co., Ltd.

Leader in the era of cloud data

Wechat: Chizcloud

Weibo: http://weibo.com/Chizcloud

Official website: http://www.chizcloud.com/

Contact & contribution: service@chizcloud.com

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report