This is the 10th day of my participation in Gwen Challenge

Author: White Snail Source: Snail Internet

preface

Technical friends should have seen all kinds of architecture diagrams drawn by the company architects. There are many kinds of boxes, and there are many concepts, such as systems, subsystems, modules, components, frameworks, etc. They all appear in the architect’s architecture diagram, so what do these terms mean? What is the relationship between them? What is the nature of architecture?

This article hopes to give you the answer!

Systems and subsystems

System is a word we hear a lot, and it’s defined in Wikipedia like this:

A system generally refers to a group of related individuals that operate according to certain rules and can accomplish tasks that individual components cannot accomplish alone.

There are three key points in this definition.

The first is association, and it has to be related individuals put together to make a system.

The second is rules, each individual has their own division of labor and cooperation mode, according to certain rules.

The third is ability, the system is not the sum of individual ability, but to produce new ability, that is, 1+1>2 effect.

For example, a computer system includes CPU, memory, disk, and IO.

IO receives data, memory stores running data, CPU performs calculations, IO outputs results, and can persist relevant information such as logs to disk.

Individuals are related to each other, have their own division of labor and cooperation rules, and perform specific calculations that no one individual can do alone.

As for subsystems, when the granularity of the system is very large, it is necessary to disassemble the system for convenient analysis.

Thus, a Subsystem can be understood as part of a larger system.

For example, wechat, which we commonly use, can be considered as a system, while chat and moments of friends are subsystems. In fact, if the perspective of the circle of friends as a system, it can also find its subsystems, such as dynamic, comments and other subsystems.

The following is a summary of the differences between systems and subsystems:

system The subsystem
English System Subsystem
Concept definition Associated individuals, rules of operation, new capabilities Part of a larger system
Example (wechat) Wechat itself is the system Chat, moments and so on are subsystems

Modules and Components

When many friends practice, they will not let you directly work on a system, but give you a module or a component to practice.

So what is a module and what is a component?

Wikipedia defines a software module as follows:

A Software Module is a set of consistent and closely related Software organizations. It contains two parts: program and data structure.

Modern software development often uses modules as units of composition.

A module’s interface expresses the functionality provided by the module and the elements needed to invoke it.

Modules are units that can be written separately, allowing a wide range of people to collaborate, write, and study different modules at the same time.

As you can see from this definition, modules have a complete set of functions and can be written separately.

The definition of a software component in Wikipedia is as follows:

A Software Component is defined as a self-contained, programmable, reusable, language-independent unit of Software that can be easily used to assemble applications.

As you can see from this definition, components are more reusable and assemblable. Component is easier to understand by saying “part”. A part is a physical concept and has the characteristics of being independently replaceable.

Modules and components are both units of the system. What is the difference between them?

Think of it in terms of unbundling systems.

From a logical point of view to break up the system, the resulting units are modules. For example, a student information management website system, according to logic (understandable success) split, can be divided into login registration module, personal information module.

When you physically break up a system, the resulting units are components. For example, the website system, according to the physical (can be understood as deployment environment) split into Nginx, Web server and Mysql.

The division of modules is mainly for separation of responsibilities, and the division of components is mainly for unit reuse.

Here is a summary of the differences between modules and components:

The module component
English Module Component
Concept definition A consistent and closely related software organization. A self-contained, programmable, reusable, language-independent unit of software.
Split view logic physical
Divide the purpose Separation of duties Unit of reuse
A synonym for parts
The characteristics of complete Independent and replaceable
Example (Personal Information Management System) Login module, personal information module Nginx, Web server, Mysql

Framework and Architecture

You must have used a framework when writing a module or component. You might use Spring MVC to write registration login modules, and you might use MyBatis to access Mysql components. Spring MVC and MyBatis are frameworks. What is the definition of a framework?

Wikipedia defines it this way:

Software Framework usually refers to a Software component specification that is designed to implement an industry standard or accomplish a specific basic task. It also refers to a Software product that provides the basic functions required by the specification in order to implement a Software component specification.

From the definition, we can also find that there are no more than two types of frameworks, one is component specifications, such as MVC, J2EE, and the other is software products, such as Spring MVC.

Frameworks focus on the word specification, either to create a specification or to implement a specification.

So what is architecture?

Wikipedia defines it this way:

Software Architecture is an abstract description of the overall structure and components of Software, which is used to guide the design of various aspects of large-scale Software systems.

Software architecture includes software components, the relationships between components, the characteristics of components, and the characteristics of the relationships between components.

Software architecture can be compared to the architecture of a building. Software architecture is the basis for building computer software, developing systems, and planning. It lists the tasks that development teams need to accomplish.

Analyzing the definition, we found several key words: overall structure, abstract description and software system.

“Overall structure” that architecture focuses on the structure, as to what kind of output structure, different angles can have different results, such as RUP 4 + 1 views, surrounding the use case view, from a different perspective, the logical view, the view, the deployment view and process view, each view can actually considered architecture diagram.

“Abstract description” means that the architecture is concerned with abstract content, it does not get bogged down in detail, but focuses on top-level design.

“Software system” describes the application scenario of the architecture. Not all software development needs to have a specific architecture design, it needs to be at the system level, and it also depends on the scale of the situation.

Putting this information together, we can get a more concise definition of architecture: software architecture is the top-level structure of a software system.

As shown below:

​ ​

First of all, a system is composed of a group of related individuals, which can be subsystems, modules, components, etc., that is, the architecture needs to define which individuals are contained in the system.

Second, individuals in a system need to operate according to certain rules, that is, the architecture needs to specify the rules by which individuals operate.

Finally, the system must be the highest level structure that can cover the whole system from the perspective of the system.

Perhaps now you can distinguish framework from architecture:

The framework architecture
English Framework Architecture
Concept definition Component specifications that implement industry standards or software products that implement component specifications The top-level structure of a software system
concerns specification structure
For example, Component specification: MVC, J2EE software product: Spring MVC The 4+1 view of RUP