当前位置:网站首页>Software architecture design - software architecture style
Software architecture design - software architecture style
2022-04-23 05:48:00 【The green flowers of Wang Li's family】
Software architecture is a structured element with a certain form , A collection of components , Including processing components , Connecting components and data components . The processing component is responsible for processing the data , Data components are processed information , Connecting components combine and connect different parts of the architecture .
characteristic :
1、 A pattern used to describe a particular domain of software architecture ;
2、 Software architecture provides a structure for software system 、 High level abstraction of behaviors and properties ;
3、 Software architecture is a means for project stakeholders to communicate ;
4、 Software architecture is the embodiment of early decision-making ;
5、 Software architecture is a transitive and reusable model ;
6、 Architecture restricts the quality attributes of the system , By studying software architecture, it is possible to predict the quality of software .
One 、 Software architecture modeling
Software architecture modeling is how to represent software architecture , It can be divided into five : Structural model 、 Framework model 、 dynamic model 、 Process model and function model .
Here we mainly summarize “4+1” Model view .“4+1” View model from 5 A different perspective ( Logic 、 process 、 Physics 、 Development 、 scene ) To describe the software architecture .
Logical view : It mainly supports the functional requirements of the system , That is, the services provided by the system to end users .
Development view : Also known as module view , It mainly focuses on the organization and management of software modules . Software can be organized through libraries or subsystems , such , For a software system , It can be developed by different people .
Physical view : Mainly consider how to map software to hardware , It usually takes into account the solution of the system topology 、 System installation 、 Communication, etc .
Process view : Focus on the operating characteristics of the system , Focus on some non functional requirements , For example, the performance and availability of the system . The process view emphasizes concurrency 、 Distribution 、 System integration and fault tolerance , And the main abstract process structure in the logical view . It also defines in which thread the operations of each class in the logical view are executed . The process view can be described as a multi-level abstraction , Each level focuses on different aspects .
scene : It can be regarded as an abstraction of those important system activities , It organically connects the four views , In a sense , Scenario is the most important requirement abstraction . When developing architecture , It can help designers find the components of the architecture and the relationship between them .
Two 、 Software architecture style
PS: The following is too long , Based on understanding , It's OK to know such a thing in practical work .
Please refer to :《 System architecture designer tutorial 》
1、 Data flow style
The data flow style includes batch sequence and pipeline / Filter architecture style .
(1) Batch sequence architecture style . Components are a series of computing units in a fixed order , Components interact only through data transfer . Each processing step is an independent program , Each step must be started after the previous step , The data must be complete , Deliver... In a holistic manner .
(2) The Conduit / Filter architecture style . Each component has a set of inputs and outputs , The component reads the input data stream , After internal treatment , Then the output data stream is generated , After processing , Generate output data stream . This process is usually completed through the transformation of the input stream and incremental calculation , Including enriching data through calculation and adding information , By condensing and deleting refining data , Convert data by changing the recording method , Incrementally convert data, etc . Before the input is fully consumed , The output produces . Here the component is called a filter , The connector is the pipeline for data flow transmission , Pass the output of one filter to the input of another filter .
2. call / Return to style
call / The return style includes the main program / Subroutine architecture style 、 Data abstraction, object-oriented architecture style and hierarchical architecture style
(1) The main program / Subroutine architecture style . Single thread control , Divide the problem into several processing steps , Component is the main program and subroutine . Subroutines can usually be combined into modules . Procedure calls act as an interaction mechanism , That is, it acts as a connector . The calling relationship is hierarchical , Its semantic logic shows that the correctness of the subroutine depends on the correctness of the subroutine it calls .
(2) Data abstraction and object-oriented architecture style . The components of this style are objects . An object is an instance of an abstract data type . In abstract data types , The representation of data and their corresponding operations are encapsulated . The behavior of an object is reflected in its actions of accepting and requesting . Connectors are the way objects interact , Objects interact through function and procedure calls . Objects are encapsulated , Changes to one object do not affect other objects . Objects have states and operations , Also responsible for maintaining the status . This structural style includes encapsulation 、 Interaction 、 polymorphic 、 Integrate 、 Reuse and other features .
(3) Hierarchical architecture style . The hierarchical system is organized into a hierarchical structure . Component implements virtual machine in some layers . Connectors are defined by protocols that determine how layers interact , Topological constraints include constraints on the interaction between adjacent layers . The characteristic of this style is that each layer provides services for the upper layer , Use the next layer of services , You can only see the layer adjacent to yourself . The big problem is decomposed into several progressive small problems , Step by step , It hides a lot of complexity . Modify one layer , Affect up to two layers , And usually only affect the upper layer . The upper level must know the identity of the lower level , You can't adjust the order between levels . It is a common architecture design method , Can effectively simplify the design , Make the designed system structure clear , Easy to improve the ability of reuse and product maintenance . Generally speaking , The architecture of enterprise application system can be divided into The presentation layer 、 There are three layers: the middle layer and the persistence layer .
The presentation layer . The presentation layer is mainly responsible for receiving user requests , Input to users 、 Check and control the output system , Handle some actions of the client , Including control page Jump, etc , And present the final result information to the user . The presentation layer mainly adopts MVC Structure to achieve . The controller is responsible for receiving the user's request , And decide which model should be called to handle ; then , The model calls the middle layer to process the corresponding business logic according to the user's request , And return the data ; Last , The controller calls the corresponding view to format the data returned by the model , And present it to the user through the view .
Middle layer . The middle layer mainly includes business logic layer components 、 Business logic layer workflow 、 Business logic layer entity and business logic layer framework . Business logic layer components are divided into two parts: interface and implementation class , Interfaces are used to define business logic components , Define the methods that business logic components must implement . Business logic components are usually designed according to modules , Each module is designed as a business logic component , And each business logic component is represented by multiple DAO Components as the basis , So as to provide the business logic service of the system externally . Business logic layer workflow can transfer documents between multiple participants according to some predefined rules 、 The process of information or tasks is automated , To achieve a desired business goal , Or promote the achievement of this goal . Business logic layer entities provide state programming access to business data and related functions , Business logic layer entity data can be constructed using data with complex architecture , This data usually comes from multiple related tables in the database , Business logic layer entity data can be used as part of business process I/O Parameter passing , The entities of the business logic layer are serializable , To maintain their current state . Business logic layer is the core component to realize system functions , In the form of containers , Facilitate the development of system functions 、 Code reuse and management .
Persistence layer . The persistence layer is mainly responsible for the persistent storage of data , Mainly responsible for storing business data in files 、 Database and other persistent storage media . The main function of persistence layer is to provide transparent data access for business logic 、 Persistence 、 Loading capacity .
3. Independent component style
Independent component style includes process communication architecture style and event driven architecture style
(1) Process communication architecture style . Components are independent processes , Connectors are messaging . The characteristic of this style is that components are usually named , Messaging can be peer-to-peer 、 Asynchronous and synchronous mode 、 And remote procedure calls
(2) Event driven architecture style . Components do not call a procedure directly , It's about triggering or broadcasting one or more events . Processes in other components of the system are registered in one or more events , When an event is triggered , The system automatically calls all procedures registered in this event . The triggering of an event leads to the call of a procedure in another module . Components in this style are unnamed processes , The connectors that interact between them are often implicit calls between procedures (Implicit Invocation) To achieve . The main advantage of event based implicit invocation style is that it provides strong support for software reuse , It brings convenience to the maintenance and evolution of components , Its disadvantage is that the component gives up the control of system calculation .
4. Virtual machine style
Virtual machine style includes interpreter architecture style and rule-based system style
(1) Interpreter architecture style . An interpreter usually includes an interpretation engine to complete the interpretation work , A storage area containing the code to be interpreted , A data structure that records the current working state of the interpretation engine , And a data structure that records the progress of the interpreted execution of the source code . Software with interpreter style contains a virtual machine , It can simulate the execution process of hardware and some key applications . Its disadvantage is low execution efficiency .
(2) Rules based systems . Rule based systems include rule sets 、 Rule interpreter 、 The rules / Data selector and working inside
save .
5. Warehouse style
Warehouse style includes database architecture style and blackboard architecture style
(1) Database architecture style . Database architecture is the most common form of library style . There are two main categories of components , One is the central shared data source , Save the data status of the current system , The other is multiple independent processing elements , Processing elements operate on data elements .
(2) Blackboard architecture style . Blackboard architecture includes knowledge sources 、 blackboard 、 Control three parts . The knowledge source includes several different units of independent calculation , Provide problem solving knowledge , Knowledge sources respond to changes on the blackboard , Only modify the blackboard . The blackboard is a global database , Contains all the states of the solution domain , It is the only medium for the interaction of knowledge sources . Knowledge source response is controlled by the change of blackboard state . Blackboards are usually used in systems where there is no deterministic algorithm for solving problems , For example, signal processing 、 Problem planning 、 Compiler optimization and other software system design .
版权声明
本文为[The green flowers of Wang Li's family]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230540317692.html
边栏推荐
- Mysql 查询使用\G,列转行
- 2.devops-sonar安装
- POI generates excel and inserts pictures
- protected( 被 protected 修饰的成员对于本包和其子类可见)
- JSP语法及JSTL标签
- 多线程与高并发(2)——synchronized用法详解
- js数字大写方法
- windows连接mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)
- Dwsurvey is an open source questionnaire system. Solve the problem that cannot be run and modify the bug.
- Data mining -- understanding data
猜你喜欢
C language - Spoof shutdown applet
Getting started with JDBC \ getting a database connection \ using Preparedstatement
Establish excel bookkeeping book through setting context menu
图解HashCode存在的意义
实操—Nacos安装与配置
Flutter 新一代圖形渲染器 Impeller
Flutter 新一代图形渲染器 Impeller
Sea Level Anomaly 和 Sea Surface Height Anomaly 的区别
Batch import of orange single micro service
jdbc入门\获取数据库连接\使用PreparedStatement
随机推荐
Common protocols of OSI layer
Frequently asked interview questions - 2 (computer network)
深入源码分析Servlet第一个程序
线程的底部实现原理—静态代理模式
数据处理之Numpy常用函数表格整理
MySQL创建oracle练习表
windows连接mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)
Object to map
mysql如何将存储的秒转换为日期
Excel obtains the difference data of two columns of data
poi导出excel,行相同数据自动合并单元格
PreparedStatement防止SQL注入
MySQL create Oracle exercise table
多线程与高并发(1)——线程的基本知识(实现,常用方法,状态)
橙单微服务之批量导入
MySQL transaction
Frequently asked interview questions - 3 (operating system)
50 SQL exercises, answers and detailed analysis
xxl-job采坑指南xxl-rpc remoting error(connect timed out)
SQL基础:初识数据库与SQL-安装与基本介绍等—阿里云天池