Programming ideas (POP, OOP, SOA, AOP)

1) POP-- process-oriented programming (Process-oriented programming):

Process-oriented programming is to function as the center and a programming method Reflection tissue, it is emphasized that the system is a data processing and handling processes, mainly in the programming function or process as the basic organization of the program, the system function is composed of a set of procedures and functions related sequences. Emphasized that the process-oriented function (processing), only the input and output data as the presence. This thought process of a very simple and universal ideas and methods, many human activities are of this organizational model, such as factory production and business services. Process-oriented to data processing procedure of the main line, ignoring belongs, borders and environmental processes, confused and self-service functions functions (such as people cutting down trees can be, this is a service function, but also have input output; it can provide to the external, while walking, is self-function, no input and no output), the difference between the external environment and internal tissue, as well as environmental data and raw data. From thinking in terms of more emphasis on process-oriented details, ignoring the integrity and borderline, but this is very different from the real world, because in the real world, this process does not exist in isolation, but rather belong to a objects, therefore, although the process-oriented and reflects one aspect (function), but not more or analog representation of the image of the real world, the real world.

 

2 ) OOP-- object-oriented programming (Object Oriented Programming):

      The world is composed of one object, and therefore the object-oriented way of thinking closer to the real world, the organization of object-oriented programming is also closer to the real world. Object-oriented object-centric, to distinguish the internal organization object region and the external environment, characterizing the object's internal data and the external properties to isolate, which acts as one piece with attribute, and the system function is manifested as a series of objects sequence of interactions between, the image can be more real-world analog or expression. In the programming organization, attributes and methods of an object is no longer as process-oriented storage as separate, but as a whole (final realization of the program but it is still isolated, but only on the physical implementation, this does not affect the object the two parts as a whole), thus having a better safety and encapsulation (inside the characterization attribute data needs to be accessed by providing a method of the object). Object-oriented emphasis is holistic, process-oriented and object-oriented and therefore in many ways can be complementary. At the same time due to the introduction of object inheritance and polymorphism technology makes object-oriented have a stronger, more concise expression of the real world. Thereby enhancing the organization's programming, reusability and flexibility.

       Object-oriented still retains the characteristics of process-oriented, oriented features into the process of a method of the object, it becomes a service function processing method of an object, which is part of the method still requires external input, output and also to the outside just inputs and outputs also become a target. In object-oriented programming, most of the time, we do not need to care about all aspects of a target object, some objects in the whole system is act as "raw materials" and "finished", the behavior itself is not in the scope of our concern, the other plants are in a position of some objects, we only care about the service function of these objects, the object does not require much attention to internal attributes and behavior of self, to classify these objects will have different objects of concern, such as the previously mentioned to the two types of objects, from the role which is classified in different system, called the former entity object, which called operands.

 

From the methodology is concerned, we can be process-oriented and object-oriented seen as two aspects of things - local and global (Note: The part and the whole is relative), in practice, both methods are equally important.

Process-oriented and object-oriented programming methods are two basic methods, in the underlying programming methodology.

3) SOA-- service-oriented architecture

Service-oriented to serve as the starting point, organization and coordination of related objects to provide targeted services, external interfaces to provide the necessary input parameters, the results will serve as an output, and the "service" and the organization's own calculations were packaged together for transparent to the user. In fact, service-oriented is functional (service) as the center, but the emphasis is on integrity, encapsulation function, since the package, rather than process and collaboration, integrity refers to external services as a whole to reflect ; and refers to the encapsulation process and the calculation of the service is completed, its own attributes are not directly exposed to the outside, in addition to interact through a common service interface, the user can not and do not know the specific coordination within the organization; the package from the refers to a property not dependent on the completion of the service the caller's service, the service system itself can complete the required service functions; therefore oriented services at a higher level in the program organization, the organization is a method of coarse-grained. Service-oriented and process-oriented, on the object-oriented nature is no different, the difference lies in the different levels to consider the issue. Object-oriented and process-oriented organization and used for internal management system, and is mainly used for service-oriented organization and management between systems. Service-oriented is larger object or process.

 

Service-oriented design of three principles are stateless, and clear a single instance of the service interface. Clear service interface is mandatory and necessary, but not a single instance of mandatory principles and do not belong to the state, although the state management service providers will increase the complexity of the job, and more examples of the same will increase the complexity of services (need to increase the synchronization concurrent processing, and can lead to access to uncertainty), but in many cases this is unavoidable.

Now the service-oriented architecture, mainly for interaction and integration between systems, there is a series of standards (XML, SOAP, WSDL, XSD, WS-policy, WS-BPEL, etc.).

4) AOP-- aspect-oriented.

 Aspect-Oriented should belong to the scope of object-oriented, tissue from a subject point of view, we generally use the classification method used is similar biological classification methods, to "inherit" the relationship between the main line, which we call vertical. But in fact, in addition to this longitudinal classification between target addition, we also can observe the objects go from the horizontal angle, which is the basic point of departure for aspect-oriented (section) programming. It had to solve such problems, we generally used the interface to complete, but there are two problems, one object design time are generally vertical thinking, if this time you need to consider these objects of different classes of these commonalities, will not only increase the difficulty and complexity of the design, it will result in too many classes and interfaces difficult to maintain, and second, the need to increase this dynamic behavior or responsibility for existing objects very difficult time. Now is there are many intermediate language program, the execution time is interpreted or compiled immediate execution, it also provides a good entry point to increase the responsibility of this section or behavior. Aspect-oriented with Api hook very similar.

Guess you like

Origin www.cnblogs.com/xyzq/p/11404250.html