Summarize the features of various software architectures

Source: Internet
Author: User

software Basic model = Entity (language) + connection and interaction1. Concept:

One of the core issues of software architecture design is the ability to use repetitive architectural patterns, that is, the ability to achieve schema-level software reuse. This means that the same schema can be used in different software windings. A software architecture style is a idiomatic pattern (idiomatic paradigm) that describes how systems are organized in a particular application domain.

Architectural style defines a system family, a schema that defines a glossary and a set of constraints. The glossary contains a number of artifacts and connector types, and this set of constraints indicates how the system combines these components and connectors. Architectural style reflects the structure and semantic characteristics common to many systems in the domain, and guides how to effectively organize each module and subsystem into a complete system. In this way, the software architecture style defines the glossary used to describe the system and a set of rules for guiding the component system.
The general architecture style is categorized as follows
(1) Data flow style: Batch sequence, Pipeline Z filter.
(2) Call back style: Master/subroutine, object-oriented style, hierarchy.
(3) Independent component style, event system.
(4) Virtual machine style: interpreter, rule-based system
(5) Warehouse style: Database system, hypertext system, blackboard system

2.1 Piping and filter stylesPipes and Filters

In the pipeline/filter style software architecture, each component has a set of inputs and outputs, the component reads the input data stream, is processed internally, and then produces the output data stream. This process is usually done through the transformation of the input stream and the incremental calculation, so the output is generated before the inputs are fully consumed. Thus, the component here is called a filter, and this style of connection is like a conduit for data flow, and the output of one filter is transmitted to the input of another filter. A filter that is particularly important in this style must be a separate entity, it cannot share data with other filters, and a filter does not know its upstream and downstream identities. The correctness of a pipeline/filter network output is not dependent on the order in which the filters perform the incremental calculation process.

Figure 2-1 is the pipe/filter style. A typical example of a pipeline/filter architecture is a program written in Unixshell. UNIX provides both a symbol to connect the components (the UNIX process) and a process runtime mechanism to implement the pipeline. Another notable example is the traditional compiler. Traditional compilers have always been considered a pipe system in which the output of one stage (including lexical analysis, parsing, semantic analysis, and code generation) is the input to another stage.

Figure 2?1 Architecture for pipeline/filter style

The pipeline/filter style software architecture has many good features:

(1) Make the soft component have good concealment and high cohesion, low coupling characteristic;

(2) allows the designer to regard the input/output behavior of the whole system as a simple synthesis of the behavior of multiple filters;

(3) Support software reuse. Important to provide data that is suitable for transmission between the two filters, any two filters can be connected together;

(4) System maintenance and enhance the performance of systems is simple. New filters can be added to existing systems, and old ones can be replaced by improved filters;

(5) Allow the analysis of some properties such as throughput, deadlock, etc.

(6) Support parallel execution. Each filter is completed as a separate task, so it can be executed in parallel with other tasks.

However, such a system also has a number of adverse factors.

(1) Typically causes a process to become a batch structure. This is because while filters can process data incrementally, they are independent, so designers must consider each filter as a complete transformation from input to output.

(2) An application that is not suitable for dealing with interactions. This is especially true when there is a need for incremental display of changes.

(3) because there is no common standard in data transmission, each filter increases the work of parsing and synthesizing data, which leads to degraded system performance and increases the complexity of writing filters.

2.2 Data abstraction and object-oriented styleData Abstraction and object-oriented Organization

Abstract data type concept plays an important role in software system, and now the software industry has turned to the use of object-oriented system. This style is based on data abstraction and object-oriented, and the representations of data and their corresponding operations are encapsulated in an abstract data type or object. A component of this style is an instance of an object, or an abstract data type. An object is a component called a manager, because it is responsible for maintaining the integrity of the resource. Objects are interacted with by calls to functions and procedures.

Figure 2-2 is a data abstraction and object-oriented style.

Figure 2?2 Architecture for data abstraction and object-oriented style

The object-oriented system has many advantages and has long been known:

(1) Because the object hides its representation from other objects, it can change the representation of an object without affecting other objects.

(2) The designer can break down some data access operations into a collection of interactive agent programs.

However, there are some problems with object-oriented systems:

(1) In order for an object to interact with another object through a procedure call, you must know the identity of the object. As long as the identity of an object changes, all other objects that explicitly call it must be modified.

(2) All other objects that explicitly call it must be modified and some of the resulting side effects are eliminated. For example, if a uses object B,c also uses object B, then the effect of C on the use of B may be unexpected.

2.3 Event-based implicit invocation style event-based implicit invocation

The idea of an event-based implicit invocation style is that a component does not invoke a process directly, but instead triggers or broadcasts one or more events. Procedures in other components of the system are registered in one or more events, and when an event is triggered, the system automatically invokes all the processes registered in the event, so that the triggering of one event results in a call to the procedure in another module.

Architecture, this style of components is a number of modules, which can be a number of processes, but also can be a collection of events. Procedures can be called in a generic manner, or they can be registered in system events, which are called when these events occur.

The main feature of an event-based implicit invocation style is that the event's trigger does not know which artifacts are affected by these events. This does not assume the order in which the artifacts are processed, or even what processes are called, so many implicitly called systems also contain explicit calls as complementary forms of component interaction.

There are many application systems that support event-based implicit invocation. For example, it is used in a programming environment to integrate tools, to ensure consistency constraints on data in a database management system, to manage data in a user interface system, and to support grammar checking in the editor. For example, in a system, the editor and variable monitor can register the corresponding debugger breakpoint event. When debugger stops at a breakpoint, it declares the event, and the handler is automatically called by the system, such as an editor that can roll the screen to a breakpoint, and the variable monitor refreshes the variable value. Debugger itself only declares events, does not care about which processes will start, and does not care what the processes do.

The main advantages of an implicit calling system are:

(1) It provides powerful support for software reuse. When a component needs to be added to an existing system, it is only necessary to register it in the event of the system.

(2) To improve the system to bring convenience. When one component is substituted for another, the interface of other components is not affected.

The main drawbacks of implicit calling systems are:

(1) The component abandons the control of the system calculation. When a component triggers an event, it is not determined whether other artifacts will respond to it. And even if it knows what artifacts the event registers, it does not guarantee the order in which the processes are called.

(2) The problem of data exchange. Sometimes data can be passed by one event, but in other cases, an event-based system must rely on a shared warehouse for interaction. In these cases, global performance and resource management becomes a problem.

(3) Since the semantics of the process must depend on the context constraints of the triggered event, there is a problem with the inference of correctness.

2.4 Hierarchy System style layered systems

Hierarchical systems are organized into a hierarchy, with each layer serving as a top level and as a downlevel customer. In some hierarchical systems, in addition to some carefully selected output functions, the inner layer is visible only to adjacent layers. In such a system, a component implements a virtual machine in some layers (which is partially opaque at the middle level of another hierarchy of systems). A connector is defined by a protocol that determines how layers interact, and topology constraints include constraints on interactions between adjacent layers.

This style of support is based on the design that increases the abstraction layer. This allows a complex problem to be decomposed into an implementation of a sequence of incremental steps. Since each layer affects only two tiers at the same time, providing the same interface to the adjacent layer, allowing each layer to be implemented in different ways, also provides strong support for software reuse.

Figure 2-3 is a hierarchical system style. The most extensive application of hierarchical system is layered communication protocol. In this application area, each layer provides an abstract function as the basis for upper-level communication. Lower hierarchies define low-level interactions, and the lowest layer typically defines only hardware physical connections.

Figure 2?3 Architecture of hierarchical system style

Hierarchical systems have a number of desirable properties:

(1) Support the system design based on the increment of abstraction, so that the designer can decompose a complex system by incremental steps;

(2) Support enhancements, because each layer at most and adjacent to the upper and lower layers of interaction, so the change in function most affect the adjacent upper and lower layers;

(3) Support reuse. Different implementations of the same layer can be used interchangeably as long as the provided service interface definition is the same. In this way, a standard set of interfaces can be defined, allowing for a variety of implementation methods.

However, the hierarchy system also has its shortcomings:

(1) Not every system can be easily divided into hierarchical mode, even if the logical structure of a system is hierarchical, due to the system performance considerations, the system designers have to put some low-level or advanced functions together;

(2) It is difficult to find a suitable and correct level abstract method.

2.5 Warehouse Style repositories

In the warehouse style, there are two different components: the central data structure shows the current state, the independent component is executed in the central storage, and the interaction between the warehouse and the external component will change greatly in the system.

The selection of control principle produces two main subclasses. The repository is a traditional database if a certain type of time in the input stream triggers the process execution, and on the other hand, if the current state of the central data structure triggers the selection of the process execution, the warehouse is a blackboard system.

Figure 2-4 is the composition of the blackboard system. The traditional application of Blackboard system is the field of signal processing, such as speech and pattern recognition. Another application is loosely coupled proxy data sharing access.

Figure 2?4 Composition of blackboard system

As we can see from figure 2-4, the blackboard system consists of three main parts:

(1) knowledge Sources . Knowledge sources contain independent, application-related knowledge that does not communicate directly between knowledge sources, and the interaction between them is done only through the blackboard.

(2) blackboard Data Structure . Blackboard data is the problem-solving data that is organized according to the hierarchy of the application, and the knowledge source solves the problem by constantly changing the blackboard data.

(3) control . The control is driven entirely by the state of the blackboard, and the change in the Blackboard state determines the specific knowledge used.

2.6 C2 Style

The C2 architecture style can be summed up as a parallel component network that is bound together by a set of rules. The system organization rules in C2 style are as follows:

(1) The components and fittings in the system have a top and a bottom;

(2) The top of the component should be connected to the bottom of a connecting piece, the bottom of the member should be connected to the top of a connection, and the direct connection between the member and the member is not allowed;

(3) A connecting piece can be connected with any number of other components and connectors;

(4) When the two connecting parts are connected directly, the bottom of one must be the top of the other.

Figure 2-5 is the C2 style. The connection between the component and the connector in the diagram reflects the rules of the building system in the C2 style.

Figure 2?5 Architecture of C2 style

C2 style is one of the most commonly used software architecture styles. From the C2-style organization rules and structure charts, we can conclude that the C2 style has the following characteristics:

(1) The components in the system can realize the application requirements, and can encapsulate the functions of any complexity;

(2) The communication between all the components is realized by the asynchronous message exchange mechanism which is mediated by the connecting parts;

(3) The components are relatively independent and the components are less dependent. Some artifacts in the system do not exist within the same address space, or some artifacts share a dependency hypothesis such as a particular control thread.

3 client/server style

In the style design of software architecture, the client/server (CLIENT/SERVER,C/S) style is undoubtedly the most important style. Client/server (CLIENT/SERVER,C/S) computing technology occupies an important position in the information industry, and the network computing has undergone the evolution from the host-based computing model to the client/server computing model. The application (data) service is provided by the server, and multiple clients are connected. The client/server application pattern is mostly based on the two-tier architecture application software under the "Fat client" structure. The client software is generally composed of the application and the corresponding database connection program. Server-side software is generally a kind of database system.

Both the client and the server are separate computers. When a computer that is connected to a network provides a variety of network services (such as data, file sharing, and so on) to other computers, it is called a server. The computers that are used to access server data are called clients. Strictly speaking, the client/server model is not defined from the point of view of physical distribution, it embodies a way of network data access implementation. Systems employing this structure are now widely used. such as hotels, hotel room registration, clearing system, supermarket pos system, banking, post and telecommunications network system.

The C/S mode can make full use of the advantages of the hardware environment, and the task is allocated to the client side and server side, which reduces the communication overhead of the system. At present, most of the application software systems are two-layer structure in client/server form, because the current software application system is developing to distributed Web application, both Web and client/server applications can do the same business processing and use different modules to share the logical components; Both internal and external users have access to new and existing applications, and new applications can be extended through the logic of existing applications. This is the current application system development direction.

Although the traditional C/S architecture adopts the open mode, it is only the openness of the system development level, and the specific software support is also needed in the specific application either client side or server side. Due to the lack of a user's real expectations of the open environment, C/s structure of software needs for different operating system systems to develop different versions of the software, coupled with the rapid upgrading of products, has been difficult to adapt to hundreds of computers over LAN users at the same time. And the cost is high and the efficiency is low.

The advantage of C/s structure is that it can give full play to the processing ability of client PC, and many work can be submitted to the server after client processing. The corresponding advantage is that the client responds quickly.

(1) The application server is running with less data load . The simplest database application of the C/S architecture consists of two parts, the client application and the database server program. The two can be called foreground program and background program, respectively. The machine running the database server program, also known as the application server. Once the server program is started, it waits to respond to requests from the client, and the client application runs on the user's own computer, corresponding to the database server, which can be called a client computer, and when any action is required on the data in the database, the client automatically looks for the server program and makes a request to it. The server program responds to the predetermined rules, returns the results, and the application server runs a lighter data load.

(2) The data storage management function is more transparent . In the database application, the storage management function of the data is carried out independently by the server program and the customer application, the foreground application can violate the rules, and usually the different (both known and unknown) running data, in the server program is not centralized implementation, such as the visitor's permissions, the number can be repeated, You must have a customer to establish a rule like an order. All of this is "transparent" to the end users who work in the foreground, and they can do all their work without having to ask (and usually can't interfere) with the process behind them. In the application of the client server architecture, the foreground program is not very "thin", the troublesome things are given to the server and the network. Under the C/s system, the database can not really become a public, professional warehouse, it is independent of the special management.

The disadvantages are mainly the following:

(1) applicable to LAN only . With the rapid development of the Internet, mobile office and distributed office is becoming more and more popular, which requires the expansion of our system. Remote access in this way requires specialized technology, and the system is designed specifically to handle distributed data.

(2) the client needs to install the dedicated client software . First of all, the workload of the installation, and then any computer problems, such as viruses, hardware damage, need to install or maintenance. In particular, there are many branches or stores of the situation, not the problem of workload, but the problem of distance. Also, when the system software is upgraded, each client needs to be reinstalled and its maintenance and upgrade costs are very high.

(3) There is a general limitation on the operating system of the client . may be suitable for Win98, but not for Win2000 or Windows XP. Or not for Microsoft's new operating system, let alone Linux, Unix, and so on.

(4) High maintenance costs and large investment . First, the use of C/S architecture, to select the appropriate database platform to achieve the true "unity" of database data, so that the distribution of data synchronization in both places is completely managed by the database system, but the logic of the two operators to directly access the same database can be effectively implemented, there are some problems, if necessary to establish "real-time" Data synchronization, it is necessary to establish a real-time communication connection between the two places, to keep the database server online operation, network management staff both to server maintenance management, but also to the client maintenance and management, which requires high investment and complex technical support, maintenance costs are high, maintenance tasks are large. Secondly, the traditional C/s structure software needs to develop different versions of software for different operating system systems, because of the rapid upgrading of products, high cost and low efficiency have not adapted to the work needs. After the emergence of a cross-platform language such as Java, the B/s architecture is a fierce impact on C/s, and it forms a threat and challenge.

43 Layer C/S structure style4.1 Three layer C/s basic hardware structure

The traditional two-layer C/s structure has several limitations:

L It is a single server and LAN-centric, so it is difficult to extend to large enterprise wide area network or the Internet;

L be limited to suppliers;

L Soft and hardware combination and integration capacity is limited;

L difficult to manage a large number of clients.

Therefore, the three-layer C/s structure came into being. The three-layer C/s structure is divided into three parts: presentation, function and data. The solution is to explicitly split the three layers and logically make them independent. The original data layer as a DBMS has been independent, so the key is to separate the presentation layer and functional layer into separate programs, and also to make the interface between the two layers concise and clear.

There are basically three ways to load the above three-tier functionality into hardware (). Where the presentation layer is configured in the client, and the data tier is configured on the server.

The general situation is that only the presentation layer is configured in the client, compared to the two-tier C/s structure, its program maintainability is much better, other problems have not been resolved. The client's load is too heavy and the data required for its business processing is passed from the server to the client, so the performance of the system is prone to deterioration.

If the functional layer and the data layer are placed on separate servers, data transfer between the server and server is also performed. However, since the three layers are placed on separate hardware systems in this form, the flexibility is high enough to accommodate the increase in the number of clients and the change in processing load. For example, when you append a new business process, you can increase the server that loads the feature tier accordingly. Therefore, the larger the system size, the more significant the advantages of this form.

Noteworthy is: three layer C/s structure of the communication efficiency between each layer if not high, even if the allocation to the various layers of hardware capability is very strong, as a whole, it can not achieve the required performance. In addition, the design must carefully consider the three-layer communication method, communication frequency and data volume. This is the same as raising the independence of each layer is the key problem of three-layer C/s structure.

4.2 Three-layer C/S function

1. Presentation Layer
The presentation layer is the user interface part of the application and it is responsible for the dialog between the user and the application. It is used to check the data entered by the user from the keyboard and display the output of the application. In order to enable users to operate intuitively, the general use of graphical user interface (GUI), easy to operate, easy to learn and use. When changing the user interface, you only need to overwrite the display control and data checker, without affecting the other two tiers. The content of the check is also limited to the form and value of the data and does not include the processing logic for the business itself.
The structure of the graphical interface is not fixed, which makes it easy to make changes flexibly later. For example, instead of putting a few features into a window, you split the window by function to make each window function simple and simple. In this layer of the program development is mainly the use of visual programming tools.

2. Functional Layer

The functional layer is equivalent to the ontology of the application, it is the specific business processing logically programmed into the program. For example, when making a subscription contract, the contract amount is calculated, the data is configured in a fixed format, the order contract is printed, and the data required for processing is taken from the presentation layer or the data tier. The data interaction between the presentation layer and the functional layer should be as concise as possible. For example, when a user retrieves data, it tries to transfer the information about the retrieval request to the functional layer at once (see Figure 2), and the result data processed by the functional layer is also transmitted to the presentation layer at once. In the application design, it is important to avoid a business process, a clumsy design of data exchange between the presentation layer and the functional layer.
Typically, the feature layer includes the ability to confirm user access to apps and databases, and the ability to log systems to process logs. This layer of the program is mostly developed with visual programming tools, but also using COBOL and C language.
3. Data layer
The data layer is the DBMS that manages the reading and writing of database data. The DBMS must be able to quickly perform large amounts of data updates and retrievals. The current mainstream is the relational database management system (RDBMS). As a result, most of the requirements for transferring from the functional layer to the data tier use the SQL language.

Summarize the features of various software architectures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.