Program organization (1)

The organization of the program can be divided into the organization of code, the organization of functions and the organization of storage. Process-oriented, object-oriented, aspect-oriented, microservices, SOA, etc. are actually in this category. These things are not unique to programming. Many things can be found in real production and life, and their essence is also the organization of social production and life. Part. These methods of program organization are not mutually isolated or exclusive, and can be applied and collaborated with each other. The basic objects involved in program organization are code, function and data. The externally associated objects are of course team members and customers.

The foundation for understanding and making good use of these cores is abstraction and classification. Classification and abstraction interact. Here, abstraction is the basic skill, and the purpose of abstraction is to classify and simplify implementation. The quality of classification will affect the organizational effect, so the method and basis of classification are very important.

1) Process-oriented: The organization method is classified by function, and the organization of code and function maintains a certain degree of consistency.

2) Object-oriented: The organization is based on objects, so the classification of objects is very important. At this time, the code and object classification do not have to be consistent on the file.

3) Aspect-oriented: Based on the object-oriented organization method, a method of increasing functions is essentially a function-oriented organization method. Aspect-oriented should be used with caution at the code level. Spring's AOP design itself is a very bad design. To achieve AOP, I suggest to conceive at a higher system level.

4) Microservices: The essence is a function-oriented classification and organization method, and the core is granular control.

5) SOA: The essence is a function-oriented classification organization method. Microservices can also be regarded as a kind of SOA, but in general, the granularity of SOA will be larger, while microservices are a fine-grained functional organization model.

In fact, from a higher perspective, organizational methodology is a very important content. Programming is not very special. As a programmer, you must break through this limitation so that you can expand and apply to all walks of life.

Guess you like

Origin blog.csdn.net/hawksoft/article/details/108415233