当前位置:网站首页>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 .
边栏推荐
- Linear DP acwing 895 Longest ascending subsequence
- Interesting interview questions
- High performance erasure code coding
- [ybtoj advanced training guide] similar string [string] [simulation]
- Do you know all the interface test interview questions?
- Lekao.com: experience sharing of junior economists and previous candidates in customs clearance
- JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
- 包管理工具
- IPhone 6 plus is listed in Apple's "retro products" list
- spfa AcWing 851. SPFA finding the shortest path
猜你喜欢
Rust search server, rust quick service finding tutorial
Execute any method of any class through reflection
JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)
Programmers can't find jobs after the age of 35? After reading this article, you may be able to find the answer
Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
1380. Lucky numbers in the matrix [two-dimensional array, matrix]
Anti shake throttle
8 examples of using date commands
Bom Dom
防抖 节流
随机推荐
线性DP AcWing 895. 最长上升子序列
传感器 ADXL335BCPZ-RL7 3轴 加速度计 符合 RoHS/WEEE
Linear DP acwing 902 Shortest editing distance
Async/await asynchronous function
Win10 system OmniPeek wireless packet capturing network card driver failed to install due to digital signature problem solution
C#运算符
JDBC prevent SQL injection problems and solutions [preparedstatement]
Dijkstra AcWing 850. Dijkstra求最短路 II
In development, why do you find someone who is paid more than you but doesn't write any code?
Fluent fluent library encapsulation
计数类DP AcWing 900. 整数划分
Docsify deploy IIS
BOM DOM
软件测试面试题-2022年大厂面试题合集
JS8day(滚动事件(scroll家族),offset家族,client家族,轮播图案例(待做))
Input box assembly of the shutter package
spfa AcWing 852. SPFA judgement negative ring
线性DP AcWing 897. 最长公共子序列
IPhone 6 plus is listed in Apple's "retro products" list
Intel internal instructions - AVX and avx2 learning notes