[software Architecture pattern] - Layered Architecture (Layered Architecture)

By Randy Watson,2015-02-18 04:06
16 views 0
[software Architecture pattern] - Layered Architecture (Layered Architecture)

    Layered architecture model is the most commonly used architectural patterns, also known as n-tier architecture model.Most architects, designers, developers are familiar with the model.IT with the traditional IT communications and organizational structure is very match, so most business application development naturally choose IT.

    Model description

    Layered architecture model of internal components are organized into hierarchical levels, each layer performs a specific role.Although the layered architecture model does not specify the number and types of layered, most will be divided into four layers: presentation layer (the presentation) (business), the persistence layer, business layer (persistence), the database layer (database).In some cases, the business layer and persistence layer will merge into a business, especially when the persistence logic embedded in the business layer components.So small application may only three layers, while larger and more complex applications may contain five layer even more layers.

    Layered architecture model of each layer corresponds to the application of specific roles and responsibilities.For example, the persistence layer is responsible for handling user interaction and browser communication logic, the business layer is responsible for performing certain business rules associated with the request.Architecture of the abstraction layer will need to complete the work, to meet specific business request.Display layer, for example, do not need to know also don't need to concern how to get user data, it only needs to be in a specific format to show the information on the interface.Similar to the business layer does not need to be concerned with how to display data and the data come from, it just needs to get data from the persistence layer, business logic to the data processing (calculation, aggregation, etc.), and pass the results up to show the layer.

    Figure 1 layered architecture model (layered architecture pattern)

    A characteristic of layered architecture is the separation of concerns (separation of concerns).Layer of the components in the only responsible for the logic of this layer.Show layer only deals with logic, for example, the business layer only deals with the business logic.This classifying components made in the architecture is easy to build an effective roles and responsibilities of the module, also easy to develop, test, management and maintenance, thanks to clear component interfaces and formed a limited scope.

    A key concept

    Note in figure 1-2, architecture of each layer is marked as closed (closed).This is one of the most important concept in layered architecture model.Closed layer means that a request when moving between layer and layer, it must pass through the layer below it to reach down one floor.Display layer, for example, the request must first via the business layer and then after the persistence layer can eventually reach the database layer.