The concept outlined common 10 kinds of architectural patterns, usage and its advantages and disadvantages.

This article will outline the concept of a common 10 kinds of architectural patterns, usage and its advantages and disadvantages.

Stratified mode (Layered pattern)
client / server mode (Client-server pattern)
master / slave mode (Master-slave pattern)
pipe / filter pattern (Pipe-filter pattern)
Proxy mode (Broker pattern)
peer to peer mode (Peer -to-peer pattern)
event bus mode (event-bus pattern)
model / view / controller (MVC) pattern (model-view-controller pattern)
blackboard mode (blackboard pattern)
parser mode (Interpreter pattern)

  1. Stratified mode (Layered pattern)

Stratified mode is used for structural design software for dismantling level, each level is a separate abstract, abstract for top service.

The system is usually broken down into the following four levels:

The presentation layer (also known as the UI layer)
application layer (also referred to as service layer)
business logic layer (also called a domain layer)
data access layer (also called persistence layer)

scenes to be used

Universal desktop applications
e-commerce Web application

  1. Client / server mode (Client-server pattern)

The client / server model consists of two parts: a server and multiple clients. Multiple server components while client-side components to provide services. Client initiate a service request to the server, the server will respond to the appropriate service information to the client. In addition, the server listens for requests from continuing clients.

scenes to be used

E-mail, file sharing and other online banking application

  1. Master / slave mode (Master-slave pattern)

Master / slave mode consists of two portions: master and slave devices. The main service component distributed to a plurality of jobs from the device assembly, and from these devices in accordance with the result of the feedback, to generate the final result is calculated.

scenes to be used

Replicated database, the primary database is identified as authoritative data source, each synchronized with the master database data from
the devices interconnected by a bus in a computer system (including the master and slave devices)

  1. Pipe / filter pattern (Pipe-filter pattern)

Pipe / filter pattern for constructing a system for generating and processing data streams. Each process in the encapsulated filter (filter) components, data to be processed for delivery through the conduit (pips). Buffer for both synchronous and pipeline as a filter (filter) between.

scenes to be used

Compiler, a series of filters for lexical analysis, syntax analysis, semantic analysis and code generation
work flow Bioinformatics

  1. Proxy mode (Broker pattern)

Proxy mode decoupling for assembly in a structured system. Interact far procedure call (remote service invocations) between components in the system employed. Agent (Broker) component acts as a coordinating role between the components of communication.

Component provides services to its ability (as well as service characteristics) issued to the agency, the client requests a service to both agents, the agent redirects the request to the previously published through the assembly corresponding service processing.

scenes to be used

Message middleware software: Apache ActiveMQ, Apache Kafka, RabbitMQ and JBoss, etc.

  1. Peer mode (Peer-to-peer pattern)

Peer mode called peer components (Use the peer), both as the peer client service requests to other peers, but also as a response to the server requests to other peers. Peer may change dynamically during operation their roles, i.e., either as a separate server, or client operation, but also as both client and server operation.

scenes to be used

Network File Sharing: Gnutella and G2)
streaming protocols: P2PTV and PDTP.
Streaming media applications: Spotify.

  1. Event Bus mode (Event-bus pattern)

Event event processing bus mode is applied, consists of four main components: an event source (event source), an event listener (event listener), the channel (Channel) and a bus (event bus). Event Source publishes a message to a particular channel bus, listeners subscribe to the appropriate channel, the event source published by the news channel to notify the listeners subscribe to the channel.

scenes to be used

Android developers
advertise (Notification) Service

  1. Model / view / controller (MVC) pattern (Model-view-controller pattern)

Model / view / controller mode (referred to as MVC pattern) The interactive applications split into three parts:

Model (model) - contains the core functions and data
view (view) - presenting information to the user (via a plurality of views)
controller (controller) - processing user input operation

MVC pattern represented by the internal information, user information, and presenting the received user operation mode decoupling component divided, efficient code reuse.

scenes to be used

Mainstream development language Internet constructed web application framework
Django and Rails web application development framework, etc.

  1. Blackboard mode (Blackboard pattern)

Blackboard mode is suitable for determining the non predict problem-solving strategies, mainly consists of three components:

Blackboard (Blackboard) - structured global memory for storing the solution space object
knowledge (Knowledge) Source - can be self-specific modules ideographic
control (Control) assembly - selection, configuration and implementation module

All components can access the blackboard, the new assembly can be written to the blackboard generated data object, may acquire knowledge source specific data generated from the blackboard pattern matching.

scenes to be used

Speech recognition
vehicle identification and tracking
structure of the protein identification
sonar signal analysis

  1. Parser mode (Interpreter pattern)

A parser for parsing mode programming languages, mainly used to specify the assessment process line, i.e. the statement is parsed language-specific expression, the core idea is corresponding to each class is defined as a language symbol.

scenes to be used

SQL and other database query language
protocol description language

Guess you like

Origin blog.csdn.net/xiao____hit/article/details/93405925