General system model in the Java program

zhaozj2021-02-16  46

Plane

Level is a generic architecture that helps divide a complex program into several separate parts. The level is based on their functional module division, and each level is responsible for a major function, and the package represents the logical layer. Level high layer can use a function of low levels, and the opposite is, the level of low levels cannot use a function of high levels. Table A shows a universal level mode.

Table A

Expressing display program user interface ingredients and processing user request scope is responsible for program-specific logic communication data sources helps some back-end services, such as database connections, message processing management, etc.

Defining a reasonable level is very important to the entire program, because the definition of good layers will increase maintainability and usability, which is the core of the heuristic knowledge we have discussed first.

When a slice is a program, it is most important to define the association between the layer and the layer. Subsequently, it is also important to design the association between Packages. In addition, the Packags is preferably associated with one-way, because the level high layer can call the function of the lower level, it can't.

The hierarchical purpose of the program is to increase the function's multiple calls. In general, the level low level is easier to call high levels. When you frequently use one layer, you can refer to the article "Java's Package Function". Defining a good level allows other developers more easily understand and use functions in the program.

However, hierarchical also pay special attention. Excessive levels will result in the complexity of the program. So when designing a layered, you must consider carefully.

Segmentation method

The segmentation method is to remove the non-center logic portion in the program from the central logic portion. Like the level, the segmentation method uses packages to represent logic associations. Table B shows two main segments. Table B

The main functions of data exchange in vertical procedures, including switching processes, exchange logic, and exchange rules. The non-primary function of data exchange in horizontal procedures, including error handling, mail service, database access.

When you identify a split layer, you must pay attention to each of the main purposes of each independent package. Each split level can produce meaningful package. Be sure to provide reasonable functional functions when designing Packages association.

In addition, the functional function of the vertical segmentation layer generally calls the functional function of the horizontal segmentation layer, the functional function of the horizontal segmentation layer can be called between the program or the program, the key is how you concentrate and change this. class. If the horizontal function function is called by multiple programs, the most important thing to consider how to independently call these independent functional functions.

Joint mode

In object-oriented programming, these two architectures plays a key role. In addition to independently using horizontal methods and segmented methods, the two often mix them in the actual design, so that they can reach the purpose of dividing and layered in the split. Figure A demonstrates the two levels into two segmented abstract correlation models, indicating the direction of the arrow indicates allowable association.

Figure a

to sum up

Each model represents an improved system design method. These patterns emphasize the relationship between Packages in the program, which constitutes the heuristic knowledge of packages and has important reference significance in the system design.

转载请注明原文地址:https://www.9cbs.com/read-26242.html

New Post(0)