Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common software architectures

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the common software architecture, the article is very detailed, has a certain reference value, interested friends must read it!

Common software architecture patterns: hierarchical architecture mode, client-server mode, master-slave mode, pipe-filter mode, agent mode, point-to-point mode, event bus mode, model-view-controller (MVC) mode, blackboard mode, interpreter mode and so on.

10 common software architecture patterns

Do you want to know how a large enterprise system is designed? Before the software agent development, we must choose an appropriate architecture to provide the required functions and quality features. So before applying it to design, we should understand different architectures.

What is an architectural pattern?

Wikipedia: an architecture pattern is a general, reusable solution to common problems in a given context of software architecture. Architectural patterns are similar to software design patterns, but in a broader scope.

In this article, I will briefly describe the application, advantages and disadvantages of the common architectural patterns in the following 10.

1. Hierarchical mode

two。 Client-server mode

3. Master-slave mode

4. Pipe-filter mode

5. Agent mode

6. Point-to-point mode

7. Event bus mode

8. Model-view-controller mode

9. Blackboard mode

10. Interpreter mode

1. Hierarchical mode

This pattern is used to build programs that can be broken down into multiple sets of subtasks, each of which is at some level of abstraction, and each layer provides services to a higher level. The most common four-tier system in general information systems is as follows.

Presentation layer (also known as UI layer)

Application layer (also known as service layer)

Business logic layer (also known as domain layer)

Data access layer (also known as persistence layer)

Application scenario

General desktop program

E-commerce web page program

two。 Client-server mode

The mode consists of two parts: a single server and multiple clients. The server component provides services to multiple client components. The client requests services from the server, and the server provides corresponding services to these clients. In addition, the server continues to listen for client requests.

Application scenario

Online applications such as email, document sharing and banking

3. Master-slave mode

The model consists of two parts: master node and multiple slave nodes. The master node component dispatches tasks to multiple independent slave node components, and calculates the final result based on the result returned by the slave node.

Application scenario

Database replication, the master database is considered an authoritative source and synchronized to the slave database

Peripherals connected to the computing system (master-slave driver)

4. Pipe-filter mode

This pattern is used to build systems that produce and process data streams. Each processing step is encapsulated in a filter assembly. The data to be processed is transferred to pipes, which can be used for buffering or synchronization.

Application scenario

Compiler, successive filters perform word sense analysis, syntax analysis, semantic analysis and code generation

The Workflow of Bio-data discipline

5. Agent mode

This pattern is used to build a distributed system with decoupled components. These components interact with each other through remote calls. The agent component is responsible for the communication coordination of multiple components, and the server exposes their capabilities (services and features) to the agent; the client gets the service from the agent, and the agent redirects the client to an appropriate service in the registration service library.

Application scenario

Message queuing software such as Apache ActiveMQ, Apache Kafka, RabbitMQ, and JBoss Messaging

6. Point-to-point mode

In this pattern, individual components are called peers. Peers can not only obtain services from other peers as clients, but also provide services to other peers as servers. Peers can act as clients, or servers, or both, and dynamically switch roles at no time.

Application scenario

File sharing networks, such as Gnutella and G2

Multimedia protocols such as P2PTV and PDTP

Private media programs, such as Spotify

7. Event bus mode

This mode mainly deals with events and has four main components: event source, event listener, channel and event bus. The event source publishes messages to a channel on the event bus, and the listener subscribes to a channel and learns about the messages published in the subscribed channel.

Application scenario

Android development

Notification service

8. Model-view-controller mode

This pattern, also known as the MVC pattern, divides the interactive program into three parts: the model, which contains core functions and data, the view, which displays information to the user (multiple views can be defined), and the controller, which handles user input. It is realized by dividing the internal presentation, presentation and acceptance of user information, decoupling components and allowing efficient code reuse.

Application scenario

The World wide Web Program Architecture of mainstream programming languages

Web frames, such as Django and Rails

9. Blackboard mode

This pattern is useful for problems where there is no deterministic scheme strategy. The blackboard mode consists of three main components: blackboard-structured global memory containing solution space objects, knowledge sources-special modules with self-owned representation, and control components-selection, configuration and execution modules. All components can access the blackboard, and new data objects can be generated and added to the blackboard. In the blackboard, some types of data can be found according to the matching rules of existing knowledge sources.

Application scenario

Speech recognition

Vehicle identification and tracking

Protein structure identification

Sonar signal interpretation

10. Interpreter mode

This pattern is used to design components that interpret programs written in a particular language. This component mainly specifies how to evaluate lines of program code, which are so-called statements or expressions written in a certain language, and the basic point is to classify language symbols.

Application scenario

Database query language, such as SQL

A language used to describe communication protocols

Comparison of architectural patterns

The following table outlines the pros and cons of each architectural pattern.

The above is all the contents of the article "what are the common software architectures?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report