04 Designing Architectures

47
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights Chapter 2 Designing Architectures By : Ms. Smita Dange

Transcript of 04 Designing Architectures

Page 1: 04 Designing Architectures

Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved.

Chapter 2Designing

Architectures

By : Ms. Smita Dange

Page 2: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Objectives

The Design Process Architectural Conception Refined Experience in Action :Styles and

Architectural Patterns Architectural Conception in Absence of

Experience

2

Page 3: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Goal Of the Chapter

Learn how architectures are created. Gives the idea about variety of approaches for

designing software systems.

3

Page 4: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

How Do You Design?

4

Where do architectures come from?

Method

1) Efficient in familiar terrain2) Not always successful 3) Predictable outcome (+ & - )4) Quality of methods varies

Creativity

1) Fun!2) Fraught with peril3) May be unnecessary4) May yield the best

Page 5: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Introduction

Design of software architecture occurs in an iterative manner.

The first iteration of the architecture design produces a skeleton of a system that addresses some of the “hardest” questions about the system and provides the grounds for refining the requirements.

The iterative process continues until the sub-components of a software system are defined and documented to a point where a detailed design can occur commence without architect’s direct involvement.

5

Page 6: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Engineering Design Process

Feasibility stage: identifying a set of feasible concepts

Preliminary design stage: selection and development of the best concept.

Detailed design stage: development of engineering descriptions of the concept.

Planning stage: evaluating and altering the concept to suit the requirements of production, distribution, consumption and product retirement.

6

Does this steps are equivalent to software engg part ???

Page 7: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

The Design Process (cont.)

Yes ….you can compare with waterfall model ,spiral model.. Etc of s/w engg process.

The view point represented by this process so pervades the software development world that it is hard to realize other choices are there for designing.

But this standard approaches is having problems..

What ARE the Problems????

7

Page 8: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Potential Problems

If the designer is unable to produce a set of feasible concepts, progress stops.

As problems and products increase in size and complexity, the probability that any one individual can successfully perform the first steps decreases.

The standard approach does not directly address the situation where system design is at stake, i.e. when relationship between a set of products is at issue.

As complexity increases or the experience of the designer is not sufficient, alternative approaches to the design process must be adopted.

8

Page 9: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Alternative Design Strategies Standard

Linear model described above Cyclic

As problems or infeasible approaches are identified in stage 2 to 4 of the standard model ,the process can revert to an earlier stage

Parallel After stage 1 of the standard model ,independent

alternatives are explored in parallel . Multiple independent attempts at design are initiated ,with no dependencies between them.

Independent alternatives are explored in parallel

9

Page 10: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Alternative Design Strategies Adaptive (“lay tracks as you go”)

The next design strategy of the design activity is decided at the end of a given stage

Incremental Each stage of development is treated as a task of

incrementally improving the existing design

Note : The process should be observed as it proceeds and

methods and approach used are modified as needed to focus on the best strategy and to avoid unpromising development.

10

Page 11: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

2 .Architectural Conception

If you observer the standard approaches to architectural and engineering design says that first major step consist of identifying a feasible set of alternative arrangements for the design as a whole.

Now ???? Is how to identify that set of viable arrangements??????????????? i.e feasible set

Solution is used tools . What are the tools available ? The Architectural conception is focusing on the

available tools .

11

Page 12: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

The Tools of “Software Engineering 101” The most basic design tools are

abstraction ,modularity and separation of concerns ,anticipation of change and design of generality.

Abstraction Abstraction(1): look at details, and abstract

“up” to concepts Abstraction(2): choose concepts, then add

detailed substructure, and move “down”

12

Page 13: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

How Abstraction is

tool ????

13

Page 14: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Abstraction and the Simple Machines What concepts should be chosen at the outset of a

design task? One technique: Search for a “simple machine”

that serves as an abstraction of a potential system that will perform the required task

For instance, what kind of simple machine makes a software system embedded in a fax machine?

At core, it is basically just a little state machine. Simple machines provide a plausible first conception

of how an application might be built. Every application domain has its common simple

machines.

14

Page 15: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Simple Machines

15

Domain Simple Machines

Graphics Pixel arraysTransformation matricesWidgetsAbstract depiction graphs

Word processing Structured documentsLayouts

Process control Finite state machines

Income Tax Software Hypertext SpreadsheetsForm templates

Web pages HypertextComposite documents

Scientific computing MatricesMathematical functions

Banking SpreadsheetsDatabasesTransactions

Page 16: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Abstraction ----As a Tool

Can We Say this Abstraction gives an arrangement of abstract parts .

Example : Buidling Guitar –choosing strings ,wood for fingerbard,side,top,bridge an so on.

Move further downwards as concept of abstraction are refined into more concrete structure.

Physics of vibrating strings ,wave propagation etc.

16

Page 17: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Choosing the Level and Terms of Discourse

Any attempt to use abstraction as a tool must choose a level of discourse, and once that is chosen, must choose the terms of discourse.

Alternative 1: initial level of discourse is one of the application as a whole (step-wise refinement).

Alternative 2: work, initially, at a level lower than that of the whole application. Once several such sub-problems are solved they can be

composed together to form an overall solution Alternative 3: work, initially, at a level above that of the

desired application. E.g. handling simple application input with a general

parser.

17

Page 18: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Separation of Concerns

Separation of concerns is the subdivision of a problem into (hopefully) independent parts.

For instance ,the Visual interface that a customer sees at bank’s automatic teller machines is independent from the logic used to control operation on the customer's accounts.

The difficulties arise when the issues are either actually or apparently intertwined.

18

Page 19: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Separation of Concerns (cont.)

Separations of concerns frequently involves many tradeoffs

Total independence of concepts may not be possible.

Key example from software architecture: separation of components (computation) from connectors (communication)

19

Page 20: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

The Grand Tool: Refined Experience Experience must be reflected upon and refined. The lessons from prior work include not only the

lessons of successes, but also the lessons arising from failure.

Learn from success and failure of other engineers Literature Conferences

Experience can provide that initial feasible set of “alternative arrangements for the design as a whole”.

20

Page 21: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Patterns, Styles, and DSSAs

21

Page 22: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

4. Architectural Conception in absence of Experience

22

Page 23: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Traditional Web interaction

23

Page 24: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Web services interaction

24

Page 25: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Where do Web services come from?

25

Two words: Web services

Page 26: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Service-Oriented Architecture

26

Service broker is optional depending on the SOA definition used

Page 27: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

World Wide Web Simplicity: Keep it simple Modular Design Tolerance: Be liberal in what you require but

conservative in what you do Decentralization: distributed systems

Uniform Resource Identifiers HTML (now XML) HTTP

27

Page 28: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Why do we need an architecture?

28

Building a common abstract model SOAP 1.2WSDL 1.2ChoreographyPolicy

Understanding what pieces we need E.g. what does it mean to secure Web services?

Page 29: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Web services: a definition

Definition: A Web service is a software system identified by a

URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols.

What is a Web service and what isn't? Always corner cases: expressing as core concepts and relationships

29

Page 30: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Web services core concepts and relationships

30

Page 31: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

An example: agent

An agent is a program acting on behalf of another person, entity, or process.

An agent isa computational resource An agent hasan identifier An agent hasan owner that is a legal entity An agent may provideone or more services An agent may requestzero or more services

31

Page 32: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

END OF CHAPTER 2

32

Page 33: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Domain-Specific Software Architectures A DSSA is an assemblage of software components

specialized for a particular type of task (domain), generalized for effective use across that domain, and composed in a standardized structure (topology)

effective for building successful applications. Since DSSAs are specialized for a particular domain

they are only of value if one exists for the domain wherein the engineer is tasked with building a new application.

DSSAs are the pre-eminent means for maximal reuse of knowledge and prior development and hence for developing a new architectural design.

33

Page 34: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Architectural Patterns

An architectural pattern is a set of architectural design decisions that are applicable to a recurring design problem, and parameterized to account for different software development contexts in which that problem appears.

Architectural patterns are similar to DSSAs but applied “at a lower level” and within a much narrower scope.

34

Page 35: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

State-Logic-Display: Three-Tiered Pattern

Application Examples Business applications Multi-player games Web-based applications

35

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Page 36: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Model-View-Controller (MVC)

Objective: Separation between information, presentation and user interaction.

When a model object value changes, a notification is sent to the view and to the controller. So that the view can update itself and the controller can modify the view if its logic so requires.

When handling input from the user the windowing system sends the user event to the controller; If a change is required, the controller updates the model object.

36

Page 37: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Model-View-Controller

37

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Page 38: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Sense-Compute-Control

38Objective: Structuring embedded control applications

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Page 39: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

The Lunar Lander: A Long-Running Example A simple computer game that first appeared in

the 1960’s Simple concept:

You (the pilot) control the descent rate of the Apollo-era Lunar Lander

Throttle setting controls descent engineLimited fuelInitial altitude and speed presetIf you land with a descent rate of < 5 fps:

you win (whether there’s fuel left or not) “Advanced” version: joystick controls

attitude & horizontal motion39

Page 40: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Sense-Compute-Control LL

40

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Page 41: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Architectural Styles

An architectural style is a named collection of architectural design decisions that

are applicable in a given development contextconstrain architectural design decisions that are

specific to a particular system within that contextelicit beneficial qualities in each resulting system

A primary way of characterizing lessons from experience in software system design

Reflect less domain specificity than architectural patterns Useful in determining everything from subroutine

structure to top-level application structure Many styles exist and we will discuss them in detail in the

next lecture

41

Page 42: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Definitions of Architectural Style Definition. An architectural style is a named collection of

architectural design decisions that are applicable in a given development context constrain architectural design decisions that are specific to a

particular system within that context elicit beneficial qualities in each resulting system.

Recurring organizational patterns & idioms Established, shared understanding of common design forms Mark of mature engineering field.

Shaw & Garlan Abstraction of recurring composition & interaction

characteristics in a set of architecturesTaylor

42

Page 43: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Basic Properties of Styles A vocabulary of design elements

Component and connector types; data elements e.g., pipes, filters, objects, servers

A set of configuration rules Topological constraints that determine allowed

compositions of elements e.g., a component may be connected to at most two other

components A semantic interpretation

Compositions of design elements have well-defined meanings

Possible analyses of systems built in a style

43

Page 44: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Benefits of Using Styles

Design reuse Well-understood solutions applied to new problems

Code reuse Shared implementations of invariant aspects of a style

Understandability of system organization A phrase such as “client-server” conveys a lot of information

Interoperability Supported by style standardization

Style-specific analyses Enabled by the constrained design space

Visualizations Style-specific depictions matching engineers’ mental models

44

Page 45: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Style Analysis Dimensions

What is the design vocabulary? Component and connector types

What are the allowable structural patterns? What is the underlying computational model? What are the essential invariants of the style? What are common examples of its use? What are the (dis)advantages of using the style? What are the style’s specializations?

45

Page 46: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Some Common Styles Traditional, language-

influenced styles Main program and

subroutines Object-oriented

Layered Virtual machines Client-server

Data-flow styles Batch sequential Pipe and filter

Shared memory Blackboard Rule based

Interpreter Interpreter Mobile code

Implicit invocation Event-based Publish-subscribe

Peer-to-peer “Derived” styles

C2 CORBA

46

Page 47: 04 Designing Architectures

Software Architecture: Foundations, Theory, and Practice

Main Program and Subroutines LL

47

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.