Software architecture style arrangement (2 call/return ).

Source: Internet
Author: User

 

1 call/return 1.1 Main Program/subroutine

Single-threaded control divides the problem into several processing steps. components are the main program and subprograms. Subprograms can usually be merged into modules. Process calling acts as an interaction mechanism, that is, it acts as a connector. The call relationship is hierarchical, and Its Semantic Logic is represented by the correctness of the subprogram, depending on the correctness of the subprogram it calls.

This type of program style is also relatively large, such as the early structured program.

1.2 object-oriented Style

Data abstraction and object-oriented architecture. The component of this style is an object. An object is an instance of the abstract data type. In abstract data types, data representations and their corresponding operations are encapsulated. The behavior of an object is reflected in its acceptance and request actions. A connector refers to the interaction between objects. objects are interacted by calling functions and procedures. Objects are encapsulated. Changes to one object do not affect other objects. The object has the status and operation, and has the responsibility to maintain the status. This structural style contains features such as encapsulation, interaction, polymorphism, integration, and reuse.

In this style, primitive operations that represent and connect to data are encapsulated in an abstract data type or object. The component of this style is an object, also known as an instance of the abstract data type.

Two important features of this style are:

1) The object is responsible for maintaining the integrity of its representation;

2) object representation is concealed for other objects. Because an object hides its own representation from its customers, customers of these objects can change their implementation methods without affecting it.

L advantages:

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

2) designers can break down some data access problems into a set of interactive proxies;

L disadvantages

1) In order for an object to interact with another object through a process call, the Object ID must be known.

2) as long as the identifier of an object changes, you must modify all other objects that explicitly call the object and eliminate the resulting side effects.

3) The operation associations of different objects are weak.

Object-oriented is currently the most popular programming method, basically it is nothing. however, this does not mean that other styles are not good, because it is difficult to find a program that only contains one architectural style.

1.3 hierarchy

Layered architecture style. A hierarchy is organized into a hierarchy. The component implements virtual machines at some layers. The connector is defined by a protocol that determines how the layers interact. Topology constraints include constraints on the interaction between adjacent links. This style features that each layer provides services for the previous layer. using the services of the next layer, you can only see the layers adjacent to yourself. The major problems are divided into several small and progressive problems, which are gradually solved, hiding a lot of complexity. Modifying a layer affects a maximum of two layers, but usually only the upper layer. The upper layer must know the identity of the lower layer and cannot adjust the order between layers.

Advantages:

1) supports an incremental abstraction-based system design, allowing the designer to break down a complex system in ascending steps.

2) supports function expansion. Each layer interacts with adjacent layers at most.

3) reuse is supported. Different implementations can be used as long as the service interface definition remains unchanged.

Disadvantages

1) The adaptive surface is not wide.

2) Not every system can be easily divided into a hierarchical model. Even if the logical structure of a system is hierarchical, system designers have to combine some low-level or advanced functions;

It is difficult to find a proper and correct hierarchical abstraction method.

Related Article

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.