5 categories of software architecture styles

Garlan and Shaw divide software architectural styles into 5 broad categories:

(1) Data flow style: including batch sequence architectural style (Batch Sequential) and management/filter architectural style (Pipes/Filters).

(2) Call/return style: including Main Program and Subroutine, Data Abstraction and Object-Oriented, and Hierarchical Layers.

(3) Independent component style: including the process communication style (Communicating Processes) and the event-driven style (EventSystems).

(4) Virtual machine style: including Interpreters and Rule-based Systems.

(5) Warehouse style: including database architecture style (Database) and blackboard architecture style (BlackBoards)

Others: Domain-specfic Software Architecture, StateTransition System, Distributed Process architectural style and REST (Representational StateTransfer) hybrid architectural style, etc. Among them, the distributed architectural styles include client/server (C/S) architectural style, browser/server (B/S) architectural style, CORBA, DCOM and EJB architectural styles.

Models for each specific architectural style

data flow style

①. Batch sequence architectural style. A component is a series of computing units in a fixed order, and the components only interact with each other through data transfer. Each processing step is an independent program, each step must start after the previous one has ended, and the data must be complete and passed in a holistic manner.

②. Pipe/Filter architectural style. Each component has a set of inputs and outputs. The component reads the input data stream, processes it internally, and produces an output data stream. This process is usually accomplished by transforming and incrementally computing the input stream, including enriching data by computing and adding information, refining data by condensing and deleting, transforming data by changing the way it is recorded, transforming data incrementally, etc. Before the input is fully consumed, the output is produced. The components here are called filters, and the connectors are the pipes for data flow transmission, passing the output of one filter to the input of another filter.

call/return style

①. Main program/subroutine architectural style. Single-threaded control divides the problem into several processing steps, and the components are the main program and the subprogram. Subroutines can often be synthesized into modules. A procedure call acts as an interaction mechanism, that is, as a connector. The calling relationship is hierarchical, and its semantic logic shows that the correctness of the subroutine depends on the correctness of the subroutine it calls.

②. Data abstraction and object-oriented architectural style. The components of this style are objects. Objects are instances of abstract data types. In abstract data types, the representation of data and their corresponding operations are encapsulated. The behavior of an object is reflected in the actions it accepts and requests. Connectors are the way objects interact. Objects interact through calls to functions and procedures. Objects are encapsulated, and changes to one object will not affect other objects. Objects own state and operations, and are also responsible for maintaining state. This architectural style includes features such as encapsulation, interaction, polymorphism, integration and reuse.

③. Hierarchical architecture style. Hierarchical systems are organized into a hierarchy. Components implement virtual machines at several layers. Connectors are defined by protocols that determine how layers interact, and topological constraints include constraints on interactions between adjacent conductors. The characteristic of this style is that each layer provides services for the previous layer, and only the layer adjacent to itself can be seen using the services of the next layer. A large problem is decomposed into several progressive small problems, which are solved gradually, hiding a lot of complexity. Modifying one layer affects up to two layers, and usually only the upper layer. The upper layer must know the identity of the lower layer and cannot adjust the order between the layers.

Independent component style

①. Process communication architectural style. Components are independent processes, connectors are message passing. The characteristics of this style are that the components are usually named procedures, and the message passing methods can be point-to-point, asynchronous and synchronous, and remote procedure calls.

②. Event-driven architectural style. Instead of calling a procedure directly, a widget triggers or broadcasts one or more events. Procedures 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 results in a procedure call in another module.

Components in this style are unnamed procedures, and the connection between them is often implemented as an implicit invocation between procedures. The main advantage of the event-based implicit calling style is that it provides strong support for software reuse, and brings convenience to the maintenance and evolution of components; its disadvantage is that the components give up the control of the system calculation.

virtual machine style

①. Interpreter architectural style. An interpreter usually includes an interpretation engine that performs the interpretation work, a memory 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. The software with interpreter style contains a virtual machine, which can simulate the execution process of the hardware and some key applications; its disadvantage is that the execution efficiency is low.

②. A rule-based system. Rule-based systems include rule sets, rule interpreters, rule/data selectors, and working memory.

warehouse style

①. Database schema style. Database schemas are the most common form of library style. There are two main types of components, one is a central shared data source, which saves the data state of the current system; the other is multiple independent processing elements, which operate on data elements.

②. Chalkboard architecture style. The blackboard architecture includes three parts: knowledge source, blackboard and control. The knowledge source consists of several distinct units of independent computation, providing knowledge to solve the problem, and the knowledge source responds to changes on the blackboard and only modifies the blackboard. The blackboard is a global database that contains the full state of deterritorialization and is the only medium through which knowledge sources interact. Knowledge source responses are controlled by changes in the state of the blackboard. Blackboards are usually used in systems that do not have deterministic algorithms for solving problems, such as the design of software systems such as signal processing, problem planning, and compiler optimization.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325989217&siteId=291194637