4 architectural styles

40
Architectural Design 1

Upload: cuongtvabc

Post on 17-May-2017

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 4 Architectural Styles

1

Architectural Design

Page 2: 4 Architectural Styles

2

Contents

• Software architecture and Architectural design• Common Architectural Styles

– Client/Server – Layered– Pipe and filter– Object-oriented– Component-based – Message-bus– SOA

Page 3: 4 Architectural Styles

3

Software architecture

• The design process for identifying the sub-systems making up a system and the framework for sub-system control and communication is architectural design.

• The output of this design process is a description of the software architecture.

Page 4: 4 Architectural Styles

4

Architectural design

• An early stage of the system design process.• Represents the link between specification and

design processes.• Often carried out in parallel with some

specification activities.• It involves identifying major system

components and their communications.

Page 5: 4 Architectural Styles

5

The architecture of a packing robot control system

Page 6: 4 Architectural Styles

Chapter 6 Architectural design 6

Advantages of explicit architecture

• Stakeholder communication– Architecture may be used as a focus of discussion

by system stakeholders.• System analysis

– Means that analysis of whether the system can meet its non-functional requirements is possible.

• Large-scale reuse– The architecture may be reusable across a range

of systems– Product-line architectures may be developed.

Page 7: 4 Architectural Styles

7

Architectural design decisions

• Architectural design is a creative process so the process differs depending on the type of system being developed.

• However, a number of common decisions span all design processes and these decisions affect the non-functional characteristics of the system.

Page 8: 4 Architectural Styles

8

Architectural design decisions

• Is there a generic application architecture that can be used?

• How will the system be distributed?• What architectural styles are appropriate?• How will the system be decomposed into modules?• What control strategy should be used?• How will the architectural design be evaluated?• How should the architecture be documented?

Page 9: 4 Architectural Styles

9

Architecture and system characteristics

• Performance– Localise critical operations and minimise communications.

Use large rather than fine-grain components.• Security

– Use a layered architecture with critical assets in the inner layers.

• Availability– Include redundant components and mechanisms for fault

tolerance.• Maintainability

– Use fine-grain, replaceable components.

Page 10: 4 Architectural Styles

10

Architectural views

Each architectural model only shows one view of the system.

Page 11: 4 Architectural Styles

11

4 + 1 view model of software architecture

• A logical view, which shows the key abstractions in the system as objects or object classes.

• A process view, which shows how, at run-time, the system is composed of interacting processes.

• A development view, which shows how the software is decomposed for development.

• A physical view, which shows the system hardware and how software components are distributed across the processors in the system.

• Related using use cases or scenarios (+1)

Page 12: 4 Architectural Styles

12

4 + 1 view model of software architecture

Logical View

Process View

Development View

Deployment View

Use-Case View

Page 13: 4 Architectural Styles

13

What is an Architectural Style?

• An architectural style, sometimes called an architectural pattern, is a set of principles—a coarse grained pattern that provides an abstract framework for a family of systems

• The most important benefit is that they provide a common language

Page 14: 4 Architectural Styles

14

Client/Server Architectural Style

The major components of this model are– A set of servers that offer services to other

components– A set of clients that call on the services offered by

servers– A network that allows the clients to access these

services

Page 15: 4 Architectural Styles

15

Client/Server Architectural Style

• Benefits– Sharing resources– Separation between clients and servers– Security

• Disadvantages– Single point of failure– Performance prediction is difficult

Page 16: 4 Architectural Styles

16

Layered Architecture Style

Layered architecture focuses on the grouping of related functionality within an application into distinct layers that are stacked vertically on top of each other

Page 17: 4 Architectural Styles

17

Layered architecture

• Advantages– Allows replacement of entire layers so long as the

interface is maintained• Disadvantages

– Performance

Page 18: 4 Architectural Styles

18

1-tier

Page 19: 4 Architectural Styles

19

2-tier

Page 20: 4 Architectural Styles

20

3-tier

Page 21: 4 Architectural Styles

21

Pipe and Filter Architecture Style

• This is a model of the run-time organization of a system where functional transformations process their inputs and produce outputs

• Data flows from one to another and is transformed as it moves through the sequence.

Page 22: 4 Architectural Styles

22

Pipe and Filter Architecture Style

Page 23: 4 Architectural Styles

23

Object-Oriented Architectural Style

• An object-oriented design views a system as a series of cooperating objects, instead of a set of routines or procedural instructions.

• Objects are discrete, independent, and loosely coupled; they communicate through interfaces, by calling methods or accessing properties in other objects, and by sending and receiving messages

Page 24: 4 Architectural Styles

24

Object-Oriented Architectural Style

Main benefits– Understandable. It maps the application more closely to

the real world objects, making it more understandable.– Reusable. It provides for reusability through polymorphism

and abstraction.– Testable. It provides for improved testability through

encapsulation.– Extensible. Encapsulation, polymorphism, and abstraction

ensure that a change in the representation of data does not affect the interfaces that the object exposes, which would limit the capability to communicate and interact with other objects.

Page 25: 4 Architectural Styles

25

Component-Based Architecture Style

• Focuses on the decomposition of the design into individual functional or logical components that expose well-defined communication interfaces containing methods, events, and properties

• Higher level of abstraction than object-oriented design principles

Page 26: 4 Architectural Styles

26

Component-Based Architecture Style

• Main benefits– Ease of deployment– Reduced cost– Ease of development– Reusable

Page 27: 4 Architectural Styles

27

OMA

Object Request Broker

ApplicationObjects

VerticalCORBA Facilities

HorizontalCORBA Facilities

CORBA Services

Naming, Trading, Event, etc.

User Interface, System management, Task management, etc.

Banking, Healthcare, etc.

Page 28: 4 Architectural Styles

28

CORBA

Object Implementation

Page 29: 4 Architectural Styles

29

Message Bus Architectural Style

• It is a style for designing applications where interaction between applications is accomplished by passing messages (usually asynchronously) over a common bus

• Examples– Enterprise Service Bus– Internet Service Bus

Page 30: 4 Architectural Styles

30

IntegrationApplication A

Application B

Page 31: 4 Architectural Styles

31

Accounting

Customer Relationship

Management

Human Resource

ManagementInterface

Interface

Page 32: 4 Architectural Styles

32

Spaghetti

Page 33: 4 Architectural Styles

33

Message Bus Architectural Style

ESB

Page 34: 4 Architectural Styles

34

Message Bus Architectural Style

Main benefits– Extensibility. Applications can be added to or

removed from the bus without having an impact on the existing applications

– Low complexity. Application complexity is reduced because each application only needs to know how to communicate with the bus

– Flexibility. The set of applications that make up a complex process, or the communication patterns between applications, can be changed easily

Page 35: 4 Architectural Styles

35

Service-Oriented Architectural Style

• Service-oriented architecture (SOA) enables application functionality to be provided as a set of services, and the creation of applications that make use of software services.

• Services are loosely coupled because they use standards-based interfaces that can be invoked, published, and discovered

Page 36: 4 Architectural Styles

36

Service-Oriented Architectural Style

ServiceRegistry

Service Provider

Service Client

1. publish 2. find

3. bind

Page 37: 4 Architectural Styles

37

Service-Oriented Architectural Style

Main benefits– Abstraction. Services are autonomous and accessed

through a formal contract, which provides loose coupling and abstraction.

– Discoverability. Services can expose descriptions that allow other applications and services to locate them and automatically determine the interface.

– Interoperability. Because the protocols and data formats are based on industry standards, the provider and consumer of the service can be built and deployed on different platforms.

Page 38: 4 Architectural Styles

38

Summary

• Software architecture and Architectural design• Common Architectural Styles

– Client/Server – Layered– Pipe and filter– Object-oriented– Component-based – Message-bus– SOA

Page 39: 4 Architectural Styles

39

Page 40: 4 Architectural Styles

40

References

• MSDN: http://msdn.microsoft.com/en-us/library/ee658117.aspx

• An Introduction to Software Architecture, David Garlan and Mary Shaw.

• Software Engineering, Ian Sommerville, 9th Edition