Architecture

xiaoxiao2021-04-09  547

The architecture includes a set of components and components.

The architecture style has 9 categories: 1. Data stream system, including order batch, pipeline, and filter; 2. Calling - return system, including main program and subroutine, object-oriented system, hierarchy; 3. Independent parts, including Communication process, implicit calls; 4. Virtual machine, including interpreter, rule base system; 5. Taking data-centered system (library), including database, hypertext system, blackboard system; 6. Special field style; for example, Process control, simulator; 7. Special structure, such as distributed processing, state transfer system; 8. Heterogeneous structure established by different styles; 9. Initial, the most basic main program / subroutine.

Since 1964, G. Amdahl first proposes this concept of architecture, people have a unified and clear understanding of computer systems, and laid a good foundation for the design and development of computer systems. In the past four decades, the architecture discipline has been greatly developed, and its connotation and extension have greatly enriched. In particular, the development of network computing technology has enabled network computing architecture to become a major computing mode structure in today's today. The rapid development of microelectronics technology has made chip-level architecture research a challenging topic. The tight combination and interaction of architecture and system software, application software, programming languages ​​also make today's computer and past, and triggered a large number of cutting-edge technology, related product development and basic research topics.

In the field of traditional programming, people use flowcharts to express the basic functions and implementation of the system, but the flowchart is actually just the graphical representation of the source program, and more is not available to the system analysis and developers. Information, so there is no extensive application in the actual system development process. With the size and complexity of the software system, analyze and describe the overall structure (data and control logic of data and control), which is an indispensable part of the development of large system development, obviously, the flow chart is unable to reach this Target, we must use new methods and concepts to grasp the overall structure of the system.

Systematic analysis actually includes two phases of work, first is the analysis of demand, that is, the interface between the system and the environment will be separated from the system and the surrounding environment, which is From the user's point of view, the entire system will be investigated as a whole. Secondly, the system is designed, according to the overall function and data of the system, refer to the actual physical system or similar system, the actual work-running software system, this step is actually the analysis and determination of the architecture.

From the perspective of system engineering, any complex system is relatively simple, and the currently analyzed system level is the original basic element (although in a further analysis, these elements may have a very complex internal structure). Component, there is a complex interaction between these basic elements. Therefore, the basic task of the analysis and design of the software system is to establish the basic elements in the system (which are essential to complete the functionality of the system); determine the interaction between these elements (this is the system architecture).

We have simply introduced several of the most basic architectural paradigms, their features, advantages and disadvantages, and finally give some guiding opinions of how to choose architectural paradigms in actual development.

First, the paradigm of the basic architecture

1. Pipes and filters:

Each component has a collection of inputs and outputs, and reads out data from the stream as input, generating streams of output data. The entire system can see a data processing component formed by multiple filters.

Filter A Filter B Filter C Filter A Filter D Pipeline Pipeline

Features:

The L filter is independent of each other (cannot share state), where one filter operation and behavior cannot affect the operation and behavior of additional filters, and there is no side effect. l The filter is not concerned about the source of the input stream and the output stream, and does not need to know the source and flow of the stream, the source, and the derived source of the filter do not have any effect on the data processing of the filter.

l The transfer of filtration and streaming may be concurrent, and the transmission of multiple streams can be present in the system.

Example:

One of the most famous instances is UNIX's shell programming, and multiple procedures for processing data (components) are coupled through the pipeline, producing sums of results; there is a traditional compiler, source code through lexical analysis, grammatical analysis, intermediate code Generate, the target code generation steps generates the target code of the output.

advantage:

l The functionality of the entire system is the sum of multiple filter functions, which simplifies the analysis and design of the system, and can process the entire system as a filter after the analysis of the demand, and then gradually refine into multiple interconnections. filter.

l Support for the reuse of components, the same filter can appear in different locations in the system multiple times.

l is easy to maintain and enhance, the filter can be replaced, which can increase the new filter to the system without changing the original filter, does not change the basic function of the original system.

l Essentially concurrency support, this architecture is not related to the passing of parallel streams due to substantially independent of the state of individual filters, so it is a basic system with a basic system. .

Disadvantages:

l Since the filter is independent, the designer must independently consider the input, processing, and output of each filter, which cannot be embodied in the design for the digital and interrelationships of the filter logic.

l Due to the batch characteristics of this system, it is not suitable for applications for development and user interaction.

l The common characteristics between the plurality of processing flows of the system cannot be extracted, and the common characteristics between multiple filters cannot be extracted, so the complexity of the design is added.

2. Data Abstraction and Object-Oriented System

In this system, the operations on the data and data are encapsulated into an abstract data type or object. The system consists of a large number of objects, physically, the objects interact through functions or process calls; logically, the object is reused by integration, composite, etc.

Object D Object B Object A Object E Object C Object Call Object Call Object Call Class C Class B Class C G Object A Objects E Class F Composite Inheritance

Physical structure logic structure

Features:

Object-oriented system analysis and design is too much, this is no longer detailed here.

advantage:

Due to packaging, flexibility and expansion, hidden the details of implementation, and improve the quality of the code;

Inheritance and polymorphism, improve software reusability.

Disadvantages:

The most important disadvantage is that because the interaction between the object is made by a clear object function call, when an object needs to implement a specific function, it must know which object provides this service, which reduces the system flexibility. The pipe and filter model do not need to explicitly indicate the source and go of data.

3. Event driver system

Object E Object E Objects E Event Distribution Bus Event Creating Event Receiver's Registration Create Object E This is a deformed object-oriented and data abstract system, and the system is also composed of a large number of objects, but the object is between Interaction is not based on clear indicating that the object is functioning or process call, the system provides the mechanism for the creation and release of the event, the object generates events, one or more objects to register this event by registering the system and triggered the corresponding behavior. Or generate a new event.

Example:

One of the most famous examples is the model of the GUI, the mouse, keyboard, or other input devices produce various events, windows, programs, or other objects that are triggered by these events, generating new events, data processing or other operations. advantage:

Call calls for functions and processes do not need to indicate specific objects, so the system has very good flexibility and scalability, and new components only need to register to the system's event processing section, you can immediately join the system, the same, old Components can also be easily removed from the system. This structure should be adopted for a system that requires a particularly high dynamic requirement, especially if the system needs to be expanded at runtime.

Disadvantages:

Since the function call is performed by the event transmission, the object to issue an event cannot confirm whether there is an object to handle this event. Is it a desired object to handle this event, whether to obtain the desired result, the same order cannot be controlled The correctness of the logic and timing of the system must be guaranteed by the assertion of complex timing logic and the front and rear conditions.

4. Hierarchical system

Divide system functions and components into different functional hierarchies, in general, only the uppermost components and functions can be accessed by users outside the system, and only the adjacent hierarchies can be called.

Below is a hierarchy of a basic business processing system:

User interface layer transaction logic layer core layer instance:

Obviously, ISO's OSI (Open System Interconnection) Reference Model is an example of the most famous hierarchy, by dividing the function and components of the open system into 7 levels, defining a clear (many times is too complex) hierarchy The interface that achieves complex interoperability.

advantage:

The development and design of the system can gradually be taken, and the complex and abstract functions of the high-level complex and abstraction are gradually established from the simple function of the underlying.

l Flexibility and scalability, because the adjacent hierarchy interacts through a clear interface, the specific level can be replaced and enhanced, and even new hierarchies can be added.

Disadvantages:

l Not all systems can decompose become a clear level

l Definition, logically consistent hierarchy is very difficult (OSI's failure and TCP / IP successful description of this)

l Strict hierarchical calling structures reduce system performance.

5. Knowledge Base System

Using a central data structure represents the current state of the system, a set of independent components operate on a central database. If the component is responsible for selecting, processing the central data, this system is a traditional database model; if the center data structure is independently triggered, this system can see a blackboard model.

Center Database (Knowledge Base) Customer Component A Customer Component B Customer Component C Instance:

A large amount of traditional database applications is actually a specific example of this system. In many research systems, the use of knowledge base-based blackboard models is actually this system.

advantage:

The data-centric architecture can naturally represent a large amount of data and transaction processing logic, suitable for expressing applications with data.

Disadvantages:

Only some of the simple data stock applications can be fully adopted, in a large number of actual commercial applications, completing the master handling and other logic applications must adopt other architecture expression

6. Interpreter system

If the user is very complex, for example, the various drawing instructions of AutoCAD, the user may use this system in a very complex manner, a better system is to provide a field-oriented set of instructions (language), system interpretation This language generates corresponding behavior, users use this command (language) to complete complex operations.

The business logic virtual machine interpreter described using the virtual machine language is the actual problem of the actual operation task. Real information: a large number of development tools, the secondary development tools reflect this idea: Microsoft uses a large number of Visual Basic in its products. For application, as well as the AUTOLISP language used in Autodesk products, in fact, to provide users with a domain-oriented language, then interpret the instructions and instruction sequences of this language. Thus the function of expanding the product is convenient for users to customize the system according to their own needs.

advantage:

Very good scalability, users can achieve secondary development of software systems

Disadvantages:

Software development is complex, especially the design of this set of instructions is very difficult.

Whether a mature language can be used as a basis for secondary development (for example, Java)

Second, the viewpoint of actual system development

During the actual development process, it is very difficult to determine what the architecture should be taken in a particular application. From the current trend: Simple pipeline, the filter system has been very rare, object-oriented thinking has been integrated in almost all architectures, while hierarchical ideas are also widely used, so a basic system The analysis method should be the decomposition of functions and complexity, that is, from transverse decomposition (sub-module, subsystem), longitudinal decomposition to obtain the basic component of the system (classification, hierarchical function and object). Then select the behavioral mode of the system according to the characteristics of the problem (specific architecture).

Third, the most common architecture

l Strict hierarchy (system can clearly decompose into different functional levels, such as basic graphics libraries, providing different levels of drawing interface)

This architecture is suitable for the functionality of the system relatively simple, and can be layered in software in terms of complex extent, abstraction, and relationships between hardware platforms.

l Event driver system:

This system can be employed in the case of interoperability, especially the interoperability requirements in the heterogeneous environment, and this system can be employed. When there is a large number of concurrent, there is no logical connection between the entire system (for example The operating system or graphical user interface can use this architecture. The CORBA of Microsoft COM and ISO in modern software technology is actually examples of this architecture.

l System of Knowledge Base:

This system uses this system with a large amount of data as the core. Some artificial intelligence applications also need this architecture. Object-oriented knowledge base is a development direction of this architecture. Introducing object-oriented and hierarchical ideas into a knowledge base system, a very powerful architecture will be obtained.

l System based on the interpreter:

If the application system and user interaction is very complicated, this architecture is the most suitable scheme, and only provides a simple and clear grammar and basic data operation, providing a simple and clear grammar and basic data operation. The ability to deal with the most powerful, flexible, optimal expansion new application system; a very suitable example is a browser, start, browser just simply download and display the HTML page, with the user Development of interface interactions requires JavaScript, providing a language and basic interface element manipulation instruction to obtain expansion and powerful functions.

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

New Post(0)