当前位置:网站首页>Five best software architecture patterns that architects must understand
Five best software architecture patterns that architects must understand
2022-07-02 12:45:00 【Follow me to learn java】
The world is becoming more and more dependent on software , Software system has penetrated into every aspect of human life , And bring a lot of convenience . From mobile app ( Used to contact people ), To medical applications and deep learning models , To the financial technology system , And then to intelligent buildings ( Leverage technology to automate many functions ).
In order to provide the required solutions and get the best results , These software systems must be developed using the appropriate architecture .
Patterns are problem context specific solutions .
Architecture pattern is a general and reusable solution to common software architecture problems in a specific environment .
Software defects have a great impact on an organization's business . The main reason for all software failures is to choose an inappropriate software architecture pattern , Enterprises often start application development without a formal architecture .
However , A fact that is often overlooked is : The lack of architectural design forces the development team to choose a typical pattern without guidelines . The final plan will lack clear roles 、 Responsibilities and interdependencies .
Let's take a simple example .
Online banking applications do not need to be designed as complex as the microservice paradigm . For retrieval requests , Create a client - Server architecture is enough . However , If there is no such plan , Applications can become complex , And there is no way back , Or it may lose a lot of investment in the reconstruction process .
In this paper , We'll look at what software architecture patterns are , And some of them are introduced in detail . please remember , Many patterns can be used in a single system , Optimize every part of the code with the best design .
Although we call it Computer Science , But it is often an art .
Let's take a look at what is a software architecture pattern .
1 What is the application architecture pattern ?
Consider one involving marketing App Developed software projects .
To create this application , The design and architecture must first be determined , Because this is the core , The rest of the application will be created on this basis . for example , How services will communicate or how payment integration will work ? How to use an algorithm to recommend supplier services ? And so on , be too numerous to enumerate .
Decades ago , The models that can address these challenges are limited . However , Software development has developed to the present , We already have a lot of architectural patterns , Can provide specific benefits for different types of applications .
Software architecture pattern is a repeatable solution to general software engineering problems . In the grocery store application scenario introduced earlier , We can reuse the product recommendation algorithms that have been specified , And modify them , To meet the needs of the application .
The software architecture used to implement the recommended module is only part of the overall architecture pattern .
Now? , We already know what a software architecture pattern is , Let's see why we use them .
2 Why use software architecture patterns ?
Here are three reasons why software development companies must apply software architecture design patterns when creating applications or software :
- Build a better system
Using architectural patterns , We can create transferable models . These models can be reused , This helps to form a scalable 、 Scalable optimal structure .
- Simplify design modifications
Depends on the mode used , Most architectural patterns can be modified in the early stages of development , So as to form a flexible 、 Robust 、 Error free core architecture pattern .
- Facilitate stakeholder communication
The software architecture pattern is the basic abstraction of the system , Stakeholders can communicate based on it 、 negotiation , So as to understand each other and reach a consensus .
Now? , The meaning of software architecture pattern has been made clear , Let's see 5 A popular software architecture design pattern , And where it might be used in development .

35 The best software architecture pattern
Let's look at several popular software architecture patterns , Many software companies use them to develop applications and software .
1. Layered software architecture
seeing the name of a thing one thinks of its function , Components in this design ( Code ) It is divided into sub task layers , Multiple layers are superimposed . This is probably the most common strategy . Because it is usually built around the database , So many business applications naturally store information in tables .
This is almost a self fulfilling prophecy . Many of the most popular 、 The best software framework , Such as Java EE、Drupal and Express, This structure is considered in the design . therefore , Many applications built with these frameworks naturally have a hierarchical structure .
occasionally , This is known as “N Layer architecture ”. The following designs contain a total of 4 layer .

- Presentation layer : This is the user interface layer , Here we can view and enter data into the application .
- The business layer : This layer executes the business logic as requested by the server .
- application layer : This layer is used as “ Presentation layer ” and “ The data layer ” Bridge between .
- The data layer : This layer uses databases to manage datasets .
When should I use a layered software architecture pattern ?
Layered architecture is popular for many reasons . We can start from the following scenarios / Need to consider :
- When there are fewer developers and you want to create an application quickly .
- Applications based on maintainability and separation of concerns .
- Tradition must be observed IT Enterprise applications for structures and processes .
The layered architecture pattern applies to :
- Amazon style e-commerce Web application development .
- General desktop applications .
2. Microkernel software architecture
Another name of microkernel software architecture pattern is plug-in software architecture pattern . Usually , Software teams use... When developing systems with replaceable components . The microkernel pattern consists of two basic components :
- The core system handles the most basic applications 、 The simplest operation .
- The plug-in module handles other functions and does special processing .

If you have successfully developed a chat application . The core functionality of the application is , You can exchange text messages with people all over the world , And you don't need to be connected to the Internet . After a while , You want to add voice messaging to your application , And achieved the expected function . Because microkernel mode allows you to add functions in the form of plug-ins , So you can add this function to a program that has been put into use .
When should I use the microkernel architecture pattern ?
- There is a clear boundary between the application's basic routines and higher-order rules .
- The application has a fixed set of core routines and a dynamic rule set that must be updated regularly .
- It is very suitable for distributed development teams .
The microkernel architecture pattern applies to :
- Product based applications and scheduling applications .
- Enterprise application , Because of the adaptability it pursues 、 Scalability and portability .
3. Event driven software architecture
Event driven architecture is a flexible approach . In this architecture , Software services or operations are triggered by events .
that , What exactly is an event ?
When users are using EDA When performing an action in a built application , There will be a state change and a reaction , This action is called an event .
In layered mode , Data is passed from one layer to the next in a predetermined order . by comparison , The event driven architecture pattern enables application modules to react when a particular event occurs . There are two types of event driven patterns : Mediator Topology (mediator topology) And agent topology .
When should the event driven architecture pattern be used ?
- The event driven pattern is best suited for asynchronous data flow systems in applications .
- The event driven pattern is scalable and extensible . We can add new modules without changing the existing system .
- Developers can use this pattern to create complex applications that require perfect data flow or applications that will grow .
The event driven architecture pattern applies to :
- structure JavaScript Websites and e-commerce websites .
4. Microservice software architecture
The microservice software architecture pattern builds small programs that are independent of each other but can communicate with each other , To realize the whole system ( Applications ) Normal operation of . Each microservice has its own specific responsibilities , Each team can handle its own microservices independently .

The only thing they have in common is communication . Because microservices communicate with each other , So you must make sure that the messages passed between them are backward compatible .
When an application is created in a microservice style , Add new features and update current microservices , Will not affect other micro Services . Modules created using the microservice pattern are loosely coupled . therefore , They are easy to understand 、 Modifications and extensions .
When should I use the microservice architecture pattern ?
- without doubt , Microservices are best suited for teams who want to rewrite their individual systems in a more sustainable way .
- Microservices are most suitable for large-scale and rapidly expanding applications of data systems .
- Development teams are scattered around the world .
The microservice architecture pattern is applicable to :
- Websites with a small number of components and well-defined enterprise data centers , such as Netflix.
5. Space based architecture
The main purpose of creating space-based software architecture pattern is to solve and overcome the problems of scalability and concurrency . For applications where the number of concurrent users is changing and unpredictable , It is also a good design pattern . By removing central database restrictions , Leverage data grids that are replicated to memory for high scalability .

Space based architecture distributes processing and storage across multiple servers , Minimize function crash under high load .
When should I use a space - based architecture pattern ?
- Applications and software systems that handle a large number of concurrent database accesses or writes .
- Applications that have to deal with scalability and concurrency challenges .
The space-based architecture pattern is applicable to :
- Suitable for developing e-commerce or social networking sites , Such as YouTube.
4 Choose the architecture pattern that best suits you
Other architectural patterns , Like the model - View - Controller mode 、 Blackboard mode 、 Proxy patterns and events - Bus design , It is also useful in different aspects of software development .
For everyone , The basic idea is consistent : Define the basic quality metrics for the application , Improve product function , Increase the speed and productivity of the application build process .
I hope this blog can help you understand the basic knowledge of software architecture patterns , And which applications they are best suited to , So that you can choose the application that best meets your software needs .
边栏推荐
- Record the range of data that MySQL update will lock
- bellman-ford AcWing 853. 有边数限制的最短路
- spfa AcWing 852. spfa判断负环
- 2.6 using recursion and stack - [tower of Hanoi problem]
- There is a hidden danger in CDH: the exchange memory used by the process of this role is XX megabytes. Warning threshold: 200 bytes
- Is the neural network (pinn) with embedded physical knowledge a pit?
- Browser storage scheme
- Embedded Software Engineer career planning
- 1380. Lucky numbers in the matrix [two-dimensional array, matrix]
- VLAN experiment
猜你喜欢

Direct control PTZ PTZ PTZ PTZ camera debugging (c)

C#修饰符

Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)

Js7day (event object, event flow, event capture and bubble, prevent event flow, event delegation, student information table cases)

VLAN experiment

Js1day (syntaxe d'entrée / sortie, type de données, conversion de type de données, Var et let différenciés)

Package management tools

上手报告|今天聊聊腾讯目前在用的微服务架构

JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))

线性DP AcWing 895. 最长上升子序列
随机推荐
Leetcode - Sword finger offer 51 Reverse pairs in an array
Linear DP acwing 902 Shortest editing distance
Deep Copy Event bus
The second composition template of postgraduate entrance examination English / chart composition, English chart composition is enough
JS7day(事件对象,事件流,事件捕获和冒泡,阻止事件流动,事件委托,学生信息表案例)
LTC3307AHV 符合EMI标准,降压转换器 QCA7005-AL33 PHY
基于STM32的OLED 屏幕驱动
应用LNK306GN-TL 转换器、非隔离电源
bellman-ford AcWing 853. 有边数限制的最短路
线性DP AcWing 897. 最长公共子序列
Is the neural network (pinn) with embedded physical knowledge a pit?
通过反射执行任意类的任意方法
Do you know all the interface test interview questions?
绕过ObRegisterCallbacks需要驱动签名方法
JDBC prevent SQL injection problems and solutions [preparedstatement]
[ybtoj advanced training guidance] cross the river [BFS]
[ybtoj advanced training guide] similar string [string] [simulation]
Js1day (syntaxe d'entrée / sortie, type de données, conversion de type de données, Var et let différenciés)
Anxiety of a 211 programmer: working for 3 years with a monthly salary of less than 30000, worried about being replaced by fresh students
2.7 binary tree, post order traversal - [FBI tree]