applying architectural styles and patterns. outline defining architectural patterns and style the...

17
Applying Architectural Styles and Patterns

Post on 19-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Applying Architectural Styles and Patterns

Page 2: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Outline

Defining Architectural Patterns and Style The activation model Styles and Quality Attributes

Common Architectural Styles Dataflow systems Call-and-return systems Independent components Virtual machines Respositories

Page 3: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Introduction

Relying solely on design operators to design an architecture can be a slow process.

By utilizing existing design experience from the software engineering community design productivity can be improved.

There are two types of reusable architectural products: Product families Architectural styles and patterns

Page 4: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Architectural Style

It is a type of metamodel that prescribes a set of elements and their relationships that characterize a system based on the style.

These elements are expressed as components and connectors.

Their relationships are the constraints on how components and connectors may be combined.

Page 5: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Architectural Patterns

A pattern is a solution that strikes some balance between competing forces.

However, what makes it a pattern is the fact that it is recurring.

If a design solution in its essential distilled form is found in multiple systems and is a successful design, then this solution is a pattern.

Page 6: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Architectural Patterns (Cont’d)

A pattern language is a set of patterns, together with the rules for describing how patterns are created and how they must be arranged with respect to other patterns.

The patterns are the vocabulary of the language, and the rules for their implementation and combination are the grammar.

Patterns in a pattern language can be constructed from other patterns.

Page 7: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Architectural Styles

An architectural style is a framework for a solution and not really a solution itself.

The selection of a style limits the scope of the solution space.

According to Ivar Jacobson, the architectural style of a system is “the denotation of the modeling languages used when modeling the system.”

It includes the guiding principles and prescriptions that the other development model elements must satisfy.

Page 8: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Architectural Styles (Cont’d)

It is the foundation of a philosophy of building. An architectural style defines a vocabulary of

components and connector types and a set of constraints on how they can be combined.

Most applications, however, are a combination of styles, i.e., they have a heterogeneous architectural style.

There are many parameters that we can use to characterize software architecture: The way in which control is passed between

components (activation model) The quality attribute emphasis (e.g., maintainability

and performance)

Page 9: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Activation Model

This model describes how components are activated and how information is passed between them (the control principle of the architecture).

In classic procedural languages and their object-oriented derivatives, method invocation and method execution are bound, i.e., method execution follows immediately from method invocation.

In languages like Smalltalk method invocation and method execution are decoupled.

Page 10: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Activation Model (Cont’d)

At the design level you can simulate these activation models in the language level.

Synchronous communication means that the client component activates a server component and then waits for a response.

A variation of this is the balking model in which a component may reject a request for any reason.

Page 11: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Activation Model (Cont’d)

Another variation is the timeout in which a client component assumes that the server has failed to complete a request after a certain amount of time.

Asynchronous communication means that the client doesn’t wait on a response from the server before continuing.

In the delegating pattern, a client component invokes a server component and provides an address to which the response is to be sent.

Page 12: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Activation Model – Patterns of Information Passing

Data elements can be passed directly between processing elements (pipes and filters).

Data elements may also be shared in a central store and accessed by different processing elements (repository).

Page 13: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Uses of the Activation Model

To compare different architectural styles. To identify the appropriate architectural

style for the entire system or the best combination of architectural styles.

Page 14: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Styles and Quality Attributes

Each style emphasizes a set of quality attributes while de-emphasizing another set. Pipes and filters emphasizes reusability

and adaptability but sacrifices maintainability with respect to changes in data representation.

Object-oriented systems emphasize maintainability but are not easily reused

Page 15: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Styles and Quality Attributes (Cont’d)

Repository-based systems emphasize adaptability and performance but are not highly reusable or maintainable in terms of changes to algorithms or data representations

Styles can be combined in order to exhibit different quality attributes.

Page 16: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Common Architectural Styles (Adapted from Shaw and Garlan)

Dataflow systems Batch sequential Pipes and filters

Call-and-return systems Main program and subroutine Object-oriented systems Hierarchical layers

Page 17: Applying Architectural Styles and Patterns. Outline  Defining Architectural Patterns and Style The activation model Styles and Quality Attributes  Common

Common Architectural Styles (Cont’d)) Independent components

Communicating processes Event systems

Virtual machines Interpretors Rule-based systems

Repositories Databases Hypertext systems Blackboards