The purpose of software architecture design

Source: Internet
Author: User

The purpose of software architecture design is simply to break down the software system and reduce the complexity of software system development under the premise of keeping the software internal connection, and the basic methods of decomposition software system are not layered and segmented. However, in the premise of maintaining the internal connection of the software, how to split the system hierarchically, layered into what granularity, is not an easy thing, there are a variety of decomposition methods, such as: separation of concerns, aspect, object-oriented, interface-oriented, service-oriented, dependency injection, and a variety of design principles.

Coupling can be divided into the following types, the coupling between them from high to low in the following:

(1) Content coupling: One module directly accesses the contents of another module, the two modules are said to be content-coupled.

If one of the following occurs in the program, there is a content coupling between the two modules:

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

2. One module does not move directly to the inside of another module through normal entry.

3. Two modules have part of the code overlap (This part of the code has a certain independent function).

4. A module has multiple entrances.

Content coupling may appear in assembly language. Most high-level languages have been designed to not allow content coupling. This coupling has the strongest coupling and the weakest module independence.

(2) Public coupling: A set of modules that access the same global data structure is called public coupling. A public data environment can be a global structure, a shared communication area, a common area of memory, and so on. If a module simply enters data into a public data environment, or only extracts data from a common data environment, this is a loosely shared public coupling, which is a relatively tight public coupling if the module both enters data into the public data environment and pulls data from the public Data environment.

Public coupling can cause the following problems:

1. The inability to control the access of various modules to public data seriously affects the reliability and adaptability of the software modules.

2. Make the software maintainability worse. If a module modifies public data, it affects the relevant module.

3. Reduces the software's understandable nature. It is not easy to know what data is shared by which modules, and it is difficult to debug.

Generally, public coupling is used only when there is a lot of data shared between modules and it is inconvenient to pass parameters.

(3) External coupling: A set of modules accesses the same global simple variable, and does not pass the information of the global variable through the parameter table, it is called external coupling.

(4) Control coupling: The module is not transmitted between the data information, but control information such as signs, switches, etc., one module controls the function of another module.

(5) Tag coupling: the transfer of data structures between the calling module and the called module is not simple, but also called feature coupling. The table is passed between the modules and not simple variables, but like the high-level language data names, record names and file names, such as data results, these names are tags, in fact, the address is passed.

(6) Data coupling: Only simple data item parameters are passed between the calling module and the called module. Equivalent to a value pass in a high-level language.

(7) Non-direct coupling: There is no direct relationship between the two modules, the connection between them is completely through the Master module control and call to achieve. The weakest coupling and the strongest module independence.

Summary: Coupling is an important factor affecting software complexity and design quality, in order to improve the independence of the module, the system should be built as loosely as possible, in the design we should adopt the following principles: if there must be a coupling between the modules, we should try to use the data coupling, less with the control coupling, use or control the public coupling carefully, and limit the scope of public coupling, as far as possible to avoid content coupling.

Ziyun (shenzhen) Software Co., Ltd.

Cloud data Generation leader

: Chizcloud

Weibo: Http://weibo.com/Chizcloud

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

The purpose of software architecture design

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.