Reading Notes 04 Software Architecture

8. Model - View - Mode Controller (MVC mode)

This mode is also referred to as MVC model, it interactive application into three parts,

 

Model - contains the core functionality and data

View - to display user information (may be more than one view)

Controller - processing user input object for this is the internal representation of the information and information to the user and the user mode from the acquired separated. This can effectively decoupling components and code reuse.

usage

 

The main architecture of the web application programming language.

web framework, e.g. Django and Rails.

9. blackboard mode

This mode can be used to solve the problem with no known deterministic program strategies. Blackboard mode consists of three main components.

 

Blackboard - a structured global memory object that contains the solution space.

Knowledge Source - have their own representative professional module.

Control assembly - selection, configuration, and execution module. All components can access the blackboard. Components may produce a new data object to a blackboard. Looking for specific types of data components on a blackboard, and the possibility of using existing knowledge sources, to find by way of pattern matching data.

usage

 

Speech Recognition

Vehicle identification and tracking

Identifying protein structures

Heiner signal analysis

10. Interpreter pattern

This mode is used to explain the design components of a program written in language specific. It mainly specifies how to evaluate the program line, which uses specific language statement or expression. The basic idea is to set up a class for each symbol language.

 

usage

 

Database query languages ​​such as SQL.

Computer language used to describe the communication protocol.

Compare the pros and cons of architectural patterns

The following chart summarizes the advantages and disadvantages of various architectural pattern.

first name

Advantage

Disadvantaged

Stratified mode

Different low-level components of high-level components that can be invoked. Clearly defined hierarchy, so the level of standardization easier. When changes in the level will not affect the other levels

It is not universally applicable. In some cases, some level may be skipped

The client - server mode

Well the client requested service modeling

Request is assigned to a different thread processing on the server side. Because different clients have different display formats, interprocess communication can lead to additional overhead.

Master-slave mode

Accuracy - the service is delegated to subordinate components have different implementations of execution

Dependent components isolated from one another: no shared state between. Master-slave communication delays in some scenes is a problem, such as real-time systems. This mode can only be used to solve the problem can be decomposed.

Pipe filter model

Parallel processing. When the output data stream and are output, the filter calculation starts upon the data received. Easy to increase the filter, system expansion is good. Filters can be multiplexed. Different pipe can be constructed by recombining existing filters

Efficiency will be limited by the slowest processor filter. When data is transferred from one filter to another, there is overhead data conversion.

Proxy mode

Allows objects to dynamic changes, increase, decrease and migration, and the distribution of objects is transparent to the developer.

We need to standardize the service description.

Point to Point mode

Support distributed computing. For any high robustness failed node. Depending on resources and expand high computational efficiency.

Because each node is a voluntary cooperation, quality of service can not be guaranteed. Difficult to ensure security. Performance depends on the number of nodes.

Event Bus mode

Easy to add publishers, subscribers and connections. This mode is very effective for highly distributed applications.

Scalability of the model can be a problem, because all messages are transmitted through the same event bus.

Model - View - Controller Mode

The same model can easily have multiple views, you can build connected and disconnected at runtime.

Increased complexity. Update may lead to many unnecessary user operations.

Blackboard mode

Easy to add applications. Easy to expand the structure of the data space.

Difficult to modify the structure of the data space, as it will affect all applications. You may need to synchronize and access control.

Interpreter pattern

It is possible to achieve highly dynamic behavior. Facilitate end-user programmability. Increase flexibility because it is easier to replace the interpreted code.

Because the execution speed of an interpreted language than compiled languages ​​are generally slow, so performance can be a problem.

Guess you like

Origin www.cnblogs.com/z245894546/p/11003930.html