Lecture 12 - Ph.D Program @ GCCIS

prunelimitΔίκτυα και Επικοινωνίες

23 Οκτ 2013 (πριν από 3 χρόνια και 10 μήνες)

92 εμφανίσεις

Lecture 12

Software Design and Architecture


Roadmap for Today



Software Architecture


Break


Alloy Modeling


Corey


Software Architecture Analysis


Fernado

Review Lecture 11





Z Language and Modeling, OCL Homework

Lecture 11
: Integers are the only arithmetic type built into Z

Software Architecture: Introduction

Moving from Problem to Solution

Requirements

Architectural
Design

System attributes, anticipated

changes, design constraints

Use Cases

System Sequential

Diagrams


Class Diagrams

Design goals

Architecture



subsystem structure



subsystem interfaces

What is Software Design?

A software design expresses a solution to a
problem in programming language independent
terms.


This permits a design to be implemented in any
programming language.

What is a Software Architecture?



An
architecture is considered to consist of components
and

the
connectors (interactions) between
them



Model
of software structure in terms of subsystems and their
relationships.



Design vs.
Architecture


Design explicitly addresses functional requirements


Architecture explicitly addresses functional and non
-
functional
requirements such as:


reusability, maintainability, portability, interoperability,
testability, efficiency, and
fault
-
tolerance



Challenges
in Software Architecture





Architecture design or selection:



create or select an architecture based on a set of functional, performance, and quality
requirements?




Architecture representation:



communicate an architecture?




Architecture evaluation and analysis:



analyze an architecture to predict qualities about the
systems



compare and choose between competing architectures




Architecture
-
based development and evolution:



build
and maintain a system where components may not exist or are incompatible




Architecture
recovery
:



evolve a legacy system when changes may affects its architecture?



extract architecture from supplied
documentation


Software Architecture Styles

Software Architecture Styles


An architectural style is a description of
component and connector types and a pattern of
their runtime control and/or data
transfer


Examples:


main program with subroutines


data abstraction


implicit invocation


pipes and filters


repository (blackboard)


layers of abstraction




A List of Common Architecture Styles


Dataflow Systems


Batch sequential, pipes and filters



Call and return systems


Main program and subroutine, OO systems, Hierarchical layers



Independent components


Communicating processes, event systems



Virtual Machines


Interpreters, rule
-
based systems



Data center Systems


Databases


Hypertext systems


Blackboards

Components and Connectors







Components are connected by
connectors


They are the building blocks with which an
architecture can be
described

Types of components


computational
: does a computation of some sort. E.g.
function, filter
.



memory
: maintains a collection of persistent data. E.g.
data base, file system, symbol table.



manager
: contains state + operations. State is retained
between invocations of operations. E.g.
adt
, server.



controller
: governs time sequence of events. E.g.
control module, scheduler.

Types of connectors



procedure call (including RPC)


data flow (e.g. pipes)


implicit invocation


message passing


shared data (e.g. blackboard or shared data
base)


instantiation

Describing architectural
styles


problem
: type of problem that the style addresses. Characteristics
of the
reqs’s

guide the designer in his choice for a particular style
.



context
: characteristics of the environment that constrain the
designer,
req’s

imposed by the style.



solution
: in terms of
components

and
connectors

(choice not
independent), and
control structure

(order of execution of
components)



variants



examples


Main
-
program
-
with
-
subroutines style


problem: hierarchy of functions; result of functional decomposition, single
thread of control

context: language with nested procedures

solution:


system model: modules in a hierarchy, may be weak or strong,
coupling/cohesion arguments


components: modules with local data, as well as global data


connectors: procedure call


control structure: single thread, centralized control: main program pulls the
strings

variants: OO versus non
-
OO

Abstract
-
data
-
type style


problem: identify and protect related bodies of information. Data
representations likely to change.

context: OO
-
methods which guide the design, OO
-
languages which provide
the class
-
concept

solution:


system model: component has its own local data (= secret it hides)


components: managers (servers, objects, adt’s)


connectors: procedure call (message)


control structure: single thread, usually; control is decentralized

variants: caused by language facilities


Implicit
-
invocation style



problem: loosely coupled collection of components. Useful for
applications which must be reconfigurable.


context: requires event handler, through OS or language.


solution:


system model: independent, reactive processes, invoked when an event is
raised


components: processes that signal events and react to events


connectors: automatic invocation


control structure: decentralized control. Components do not know who is
going to react.


variants: Tool
-
integration frameworks, and languages with special
features.

Pipes
-
and
-
filters style



problem: independent, sequential transformations on ordered data.
Usually incremental, Ascii pipes.


context: series of incremental transformations. OS
-
functions transfer data
between processes. Error
-
handling difficult.


solution:


system model: continuous data flow; components incrementally transform
data


components: filters for local processing


connectors: data streams (usually plain ASCII)


control structure: data flow between components; component has own flow


variants: From pure filters with little internal state to batch processes


Repository style


problem: manage richly structured information, to be manipulated in
many different ways. Data is long
-
lived.

context: shared data to be acted upon by multiple clients

solution:

system model: centralized body of information. Independent computational
elements.

components: one memory, many computational

connectors: direct access or procedure call

control structure: varies, may depend on input or state of computation

variants: traditional data base systems, compilers, blackboard systems

Shared Data

Client

Client

Client

Layered style

problem: distinct, hierarchical classes of services. “Concentric circles” of
functionality

context: a large system that requires decomposition (e.g., virtual machines,
OSI model)

solution:


system model: hierarchy of layers, often limited visibility


components: collections of procedures (module)


connectors: (limited) procedure calls


control structure: single or multiple threads

variants: relaxed layering

Layer
n

Layer
2

Layer
1

Model
-
View
-
Controller (MVC) style

problem: separation of UI from application is desirable due to expected UI
adaptations

context: interactive applications with a flexible UI

solution:


system model: UI (View and Controller Component(s)) is decoupled from the
application (Model component)


components: collections of procedures (module)


connectors: procedure calls


control structure: single thread

variants: Document
-
View

Model

View

Controller

n

n

Software Architecture: Case Studies

Case Study 1
-

KWIC:
Key
Word in Context


Problem [Parnas72]:


The
KWIC [Key Word in Context] index system accepts
an ordered set
of lines
, each line is an ordered set of
words,
and each
word is an
ordered set
of characters.
Any line may be ``circularly shifted'' by
repeatedly
removing
the first word and appending it at the end of
the line.
The KWIC
index system outputs a listing of all
circular shifts of all lines
in alphabetical
order.

Architectural Design for the KWIC System

1
.
Main
-
program
-
with
-
subroutines
style

Architectural Design for the KWIC System

2
.
Abstract
-
data
-
type style

Wild & Crazy Ideas


Software/Hardware
Co
-
design


Concurrency, Many cores
-

what does it mean
for software engineers?





How we can change:



Software process



Software architecture



Programming language


…….