Top Banner
D i d A hit t Design and Architecture (Components and Connectors, with Style) Lecture: Software Engineering Slides based on lecture by Nenad Medvidovic 1 Slides based on lecture by Nenad Medvidovic
65

SWE-JKU-Lecture07 - Architecture and Design - How to Get There

May 29, 2017

Download

Documents

Silviu Boldeanu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

D i d A hit t Design and Architecture (Components and Connectors, with

Style)Lecture: Software Engineeringg g

Slides based on lecture by Nenad Medvidovic

1

Slides based on lecture by Nenad Medvidovic

Page 2: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Software-Intensive Systems(M d l B d S t E i i )(Model-Based Systems Engineering)

Instructor: A. Egyedgy

Course offered next semester:- Focus on architecture and design modeling techniques- Focus on modeling strategies

Focus on analysis of models and their maintenance and refinement- Focus on analysis of models and their maintenance and refinement

- Focus on applications and case studies

2

Page 3: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Why Software Architecture?drawing rectangles on main screen

Listening to Button cl icks (play, stop, quit, movies)

lab el2 is pa ssed vi a Vi deo to GOP to beco me t ime

screen i s passe d via Video to DataStore to become screen

VODClientListener4

VODClientListener4()actionPerformed()

BorderPanelbo rder : intimgw : intimgh : int

BorderPa nel()BorderPa nel()BorderPa nel()BorderPa nel()clearscreen()insets()pa int()setImage()

be ve lPan el2

panel1

panel2

bevelPanel3

GUI Streamer

label1 is passed to Video to become fps

Ru nn ab le(from lang)

Sl iceHeaderslice_start_code : intquantizer_scale : intextra_bit_sl ice : booleanextra_information_slice : int

Sl iceHeader()

ActionListener(from event)

VODClientListener1

VODClientListener1()actionPerformed()

VODClientListener2

VODClientListener2()actionPerformed()

VODClientListener3

VODClientListener3()actionPerf ormed()

...

actionListener

VODClientisS ta nd al on e : b oo le an

VODCl ien t()bu tto nControl 1_ actio nP erfo rme...bu tto nControl 2_ actio nP erfo rme...bu tto nControl 3_ actio nP erfo rme...bu tto nControl 4_ actio nP erfo rme...pro ce ssWind owEve nt()cle armovie()de stroy ()ge tApp letIn fo()ge tPara meterInf o()ini t()jbI nit ()ma in ()...

-this$0

-this$0

-this$0

-thi s$0

vthread

Label( from awt)

label1label2lab el3 SliceHeaderNew

Ma crob lockNew

MacroblockNew()

MacroHeaderma crob lock_address_ increm en t : in tma crob lock_type : int

vod

fpsSlice

Slice()setstream()read_sl ice()is_nextsl ice()

header

macro

macro

Macroblo ckMacroblo ck()

BitInputSt reambitpositi on : intmask_last[ ] : short = {255,255,127,63,31,15,7,3,1 }BUFFERMAX : int = 256MA X : int = 255buffer[] : inttbuf[] : bytebufferinde x : int

instream

in

InputStream(from io)

$inputStream

Business Logic

Frame(f rom awt)

ServerSelectListener1

Se rverS el ectL isten er1()act ionP erformed ()

Se rverSelectL isten er2

ServerSelectListener2()actionPerformed()

ServerSelectListener3

ServerSelectListener3()actionPerformed()

Thread(from lang)

Movie

Movie()Movie()addscreen_shut()getactor()getdescription()getdirector()getscreen_shut()getstream_url()getti tle()

Button(from awt)

bu tto n1button2

buttonControl1

but tonControl2buttonControl3

buttonControl4

Se rverReqconnected : booleanport : int

vthread

curmovie

butto nControl 1

buttonControl2buttonControl3

buttonControl4

parent

serve r URL( from net)

url

Label(from awt)

PictureHeadertemporal_reference : intpicture_coding_type : intvbv_delay : intful l_pel_forward_vector : booleanforward_f_code : intforward r size : int

quan tizer_scal e : intmo tion_hori zo ntal_fo ward_code : i ntmo tion_hori zo ntal_fo ward_r : i ntmo tion_vert ical_ fo wa rd _cod e : intmo tion_vert ical_ fo wa rd _r : i ntmo tion_hori zo ntal_backward_co de : i ntmo tion_hori zo ntal_backward_r : intmo tion_vert ical_ backward _code : i ntmo tion_vert ical_ backword _r : i ntcoded_ block_pat te rn : i ntslice_start_cod e : intslice_quanti ze r_scale : intext ra_b it_ sli ce : boolea next ra_info rmat ion_sli ce : i ntdc_dct_ pred [] : intPM V[][] : i ntpat te rn_cod e[] : i ntMB Areset : boolean

Ma croHea der()

DataStorema cro

VideoVideo()destroy()parse_sequence_header()run()setratecontrol()setvideostream()stopmovie()

video

starts in

movieurl time

Pictureprev : intpflag : boolean

Picture()read_picture()setstream()

header

picture

Macroblo ck()calcMV ()ge tBMBtype()ge tCBP()ge tDCchrom ()ge tDClum ()ge tDMBtype()ge tIMB type()ge tMBA()ge tMV()ge tPMBtype()ge tin te rblock()ge tin te rblock1 ()ge tin trablock()is_ nextsl ice()moti on _vec tor()read_m acro block()read_sl ice()setst ream()

he ad er

store

buffersize : int

BitInputStream()close()bytealign()bytealigned()flushal igned()flushbits()next_start_code()nextaligned()nextbits()readaligned()readbit()readbits()readbuffer()readbyte()readint()readsho rt()

instream

i nstream

instream

act o e o ed()

Panel(from awt)

Label(from awt)

BorderPanelborder : in timgw : i ntimgh : i nt

BorderPanel()BorderPanel()BorderPanel()BorderPanel()c learscree n()insets()pai nt()setImage()...

BorderPanelborder : intimgw : intimgh : int

BorderPanel()BorderPanel()BorderPanel()BorderPanel()clearscreen()insets()paint()setImage()setImageSize()update()

Movie(from VODServer)ServerSelect

ServerSelect()button1_actionPerformed()button2_actionPerformed()jbInit()textField1_actionPerformed()

-this$0

-this$0-this$0

panel1

lab el 1label2

bevelPanel1

bevelPanel2

label4

bevelPanel1

bevelPanel2

ListFrame

ListFrame()buttonControl1_actionPerforme. ..buttonControl2_actionPerforme. ..buttonControl3_actionPerforme. ..buttonControl4_actionPerforme. ..changeserver()

listframe

serverselect

Socket(from net)

DataInputStream(from io)

ServerReq()connect()connect()disconnect()gethost()getmovie()getmovielist()terminateConnection()isConnected()

server

sock

i nstre am

DataOutputStream(from io)

outstream

Client(f rom VODServer)

l istf rame

Sequ en ce Heade rho rizon ta l_size : in tverti cal_size : in tmb_wi dth : intmb_he ight : i nt

GOPHeaderdro p_fram e_f lag : bo ol e. ..tim e_cod e_ ho urs : in ttim e_cod e_ minute s : in tma rker_bit : boo lean

forward_r_size : intforward_f : intful l_pel_backward_vector : booleanbackward_f_code : intbackward_r_size : intbackward_f : intextra_bit_picture : booleanextra_information_picture : int

PictureHeader()

Da taStore ()MB Ainc()change _q uan tie rscal e()cle arbl ock()cle arprevdispt ime()de code bl ock()exchan ge Iframe ()exchan ge Pfra me()exchan ge fra me()ge tMBA()ge tbackward _r_size()ge tblock()ge tfo rward_r_size()ge tfu ll_pel_ ba ckward _vector()ge tfu ll_pel_ fo rward_ ve cto r()ge tmacro bl ock_typ e()ge tpicture _codin g_type ()ge tqua nt_scal e()ne wf rame ()ne wslice()ne wsqu en ce ()resetMBA ()resetpa std ct ()

screen

picture

gop

he ad er

GOPnu mofpic : inttype : i ntTIME : in t = 0FRAME : int = 1

GOP()clearnumofpi c()ge tnum ofpic()read_g op ()setst ream()

go p

headersto re

store

store

in

Panel(from awt)

ImageButtonwid th : inthei ght : in tt yp e : int

ScreenPanel

Frame(from awt)

Color(from awt)

col1

col2

De tai lLi sten er1

Detai lListener1()actionPerformed()

Label(from awt)

But ton(from awt) IDCT

IDCT()fast_fidct64_rowcol()

Frame(from awt)

FrameImageF I ()Imag eB utto n

BorderPanelborder : intimgw : intimgh : int

BorderPanel()BorderPanel()BorderPanel()BorderPanel()clearscreen()insets()paint()setImage()setImageSize()update()

col1col2

Label(from awt)

Detail

Detai l()but ton1 _a ctionPerf ormed...jbInit()setmovi e()

-this$0label5

label1label2

label3

bu tto n1

hostreset()jbInit()

bevelPanel1

bevelPanel2

l ab el 1

detail

pe l_aspect_ra tio : intpi ctu re_rate : flo atpi ctu re_f req uency : i ntbi t_rate : intmarker_bit : boo leanvbv_bu ffe r_ si ze : i ntconstra ined_p aram eter_f lag : bo olea nload_i ntra_qu an ti zer_ma tri x : boolean...

tim e_cod e_ se cond s : in ttim e_cod e_ pi ctu re s : in tclo se d_ gop : booleanbro ke n_li nk : b oole an

GOPHe ader()

resetpa std ct ()setgo ph eader()setmacrohead er()setno ni nt ra()setpi ctu re he ad er()setratecontrol()setsequ en ce hea de r()showIfram e()showPframe ()showfra me()ski pb lock()sta rtn ewp icture()

sequence

frame

current

store

Bl ockBl k()

store

Thread(from lang)

Note: Time and PlayTimer are not used by program

Panel(from awt)

Image( from awt)

Bo rderLayout(from awt)

Image( from awt)

ypborder : in tdown : bo ol ea nenab le : b oole anNONE : in t = 1TOGGL E : i nt = 2CL ICK : in t = 3CT OGGLE : in t = 4

Imag eBut ton()Imag eBut ton()Imag eBut ton()Imag eBut ton()check()get Image ()getLabel()i sE na bl ed ()minimumSi ze ()mo useDown ()mo useUp()pai nt ()pai ntAl l()pre fe rredSize()

i t()

im2

im1

Component(from awt)

Time

Time()run()

PlayTimer

Pla yTime r()run ()sto pti me()

Label(from awt)

timer timer

imgw : intimgh : int

ScreenPanel()clearscreen()drawBar()jbInit()paint()setImage()setImageSize()update()

scree nimg

borderL ayout1

Act ionL istener

(from event)

CONSTpicture_start_cod e : int = 256slice_start_cod e_start : i nt = 257slice_start_cod e_end : i nt = 43 1use r_data_start_code : i nt = 434seq uence_hea der_ co de : int = 435seq uence_erro r_code : int = 436exten sion_start_code : i nt = 43 7reserved3 : int = 43 8seq uence end code : int = 43 9

fast_idct64_rowcol()fidct_col()fidct_row()iidct_col()iidct_row()

Image(from awt)

FrameImage()addblock()average()chrom_average()exchangepicture()getIImage()getImage()getImage()getPImage()newsequence()recon()recon_chrom()recon_chrom_down()recon_chrom_right()recon_chrom_rightdown()recon_down()recon_right()recon_rightdown()reconstruct()startnewpicture()

idct

currentImg

CONST see ms a n ob solete el ement

Imag eB utto n seems to be ob solete

ScreenPanel seems to be obsolete

BlockHeaderdc_dct_pred[] : int

BlockHeader()

Blo ck()getDCchrom ()getDClum ()get interblock()get intrablock()rea d_bl ock()setstrea m()

he ad er

Data(from lang)

Canvas(from awt)

rep ai nt()setBu tton()setEn able ()set Imag e1()set Imag e2()setLa be l()upda te()

Color(from awt)

col2col1

q _ _gro up_start_ co de : int = 440system_start_cod e_start : i nt = 441system_start_cod e_end : int = 51 1...

3

Page 4: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Why Software Architecture?drawing rectangles on main screen

Listening to Button cl icks (play, stop, quit, movies)

lab el2 is pa ssed vi a Vi deo to GOP to beco me t ime

screen i s passe d via Video to DataStore to become screen

VODClientListener4

VODClientListener4()actionPerformed()

BorderPanelbo rder : intimgw : intimgh : int

BorderPa nel()BorderPa nel()BorderPa nel()BorderPa nel()clearscreen()insets()pa int()setImage()

be ve lPan el2

panel1

panel2

bevelPanel3

GUI Streamer

label1 is passed to Video to become fps

Ru nn ab le(from lang)

Sl iceHeaderslice_start_code : intquantizer_scale : intextra_bit_sl ice : booleanextra_information_slice : int

Sl iceHeader()

ActionListener(from event)

VODClientListener1

VODClientListener1()actionPerformed()

VODClientListener2

VODClientListener2()actionPerformed()

VODClientListener3

VODClientListener3()actionPerf ormed()

...

actionListener

VODClientisS ta nd al on e : b oo le an

VODCl ien t()bu tto nControl 1_ actio nP erfo rme...bu tto nControl 2_ actio nP erfo rme...bu tto nControl 3_ actio nP erfo rme...bu tto nControl 4_ actio nP erfo rme...pro ce ssWind owEve nt()cle armovie()de stroy ()ge tApp letIn fo()ge tPara meterInf o()ini t()jbI nit ()ma in ()...

-this$0

-this$0

-this$0

-thi s$0

vthread

Label( from awt)

label1label2lab el3 SliceHeaderNew

Ma crob lockNew

MacroblockNew()

MacroHeaderma crob lock_address_ increm en t : in tma crob lock_type : int

vod

fpsSlice

Slice()setstream()read_sl ice()is_nextsl ice()

header

macro

macro

Macroblo ckMacroblo ck()

BitInputSt reambitpositi on : intmask_last[ ] : short = {255,255,127,63,31,15,7,3,1 }BUFFERMAX : int = 256MA X : int = 255buffer[] : inttbuf[] : bytebufferinde x : int

instream

in

InputStream(from io)

$inputStream

Business Logic

Business

Frame(from awt)

ServerSelectListener1

Se rverS el ectL isten er1()act ionP erformed ()

Se rverSelectL isten er2

ServerSelectListener2()actionPerformed()

ServerSelectListener3

ServerSelectListener3()actionPerformed()

Thread(from lang)

Movie

Movie()Movie()addscreen_shut()getactor()getdescription()getdirector()getscreen_shut()getstream_url()getti tle()

Button(from awt)

bu tto n1button2

buttonControl1

but tonControl2buttonControl3

buttonControl4

Se rverReqconnected : booleanport : int

vthread

curmovie

butto nControl 1

buttonControl2buttonControl3

buttonControl4

parent

serve r URL( from net)

url

Label(from awt)

PictureHeadertemporal_reference : intpicture_coding_type : intvbv_delay : intful l_pel_forward_vector : booleanforward_f_code : intforward r size : int

quan tizer_scal e : intmo tion_hori zo ntal_fo ward_code : i ntmo tion_hori zo ntal_fo ward_r : i ntmo tion_vert ical_ fo wa rd _cod e : intmo tion_vert ical_ fo wa rd _r : i ntmo tion_hori zo ntal_backward_co de : i ntmo tion_hori zo ntal_backward_r : intmo tion_vert ical_ backward _code : i ntmo tion_vert ical_ backword _r : i ntcoded_ block_pat te rn : i ntslice_start_cod e : intslice_quanti ze r_scale : intext ra_b it_ sli ce : boolea next ra_info rmat ion_sli ce : i ntdc_dct_ pred [] : intPM V[][] : i ntpat te rn_cod e[] : i ntMB Areset : boolean

Ma croHea der()

DataStorema cro

VideoVideo()destroy()parse_sequence_header()run()setratecontrol()setvideostream()stopmovie()

video

starts in

movieurl time

Pictureprev : intpflag : boolean

Picture()read_picture()setstream()

header

picture

Macroblo ck()calcMV ()ge tBMBtype()ge tCBP()ge tDCchrom ()ge tDClum ()ge tDMBtype()ge tIMB type()ge tMBA()ge tMV()ge tPMBtype()ge tin te rblock()ge tin te rblock1 ()ge tin trablock()is_ nextsl ice()moti on _vec tor()read_m acro block()read_sl ice()setst ream()

he ad er

store

buffersize : int

BitInputStream()close()bytealign()bytealigned()flushal igned()flushbits()next_start_code()nextaligned()nextbits()readaligned()readbit()readbits()readbuffer()readbyte()readint()readsho rt()

instream

i nstream

instreamLogicStreamer

act o e o ed()

Panel(from awt)

Label(from awt)

BorderPanelborder : in timgw : i ntimgh : i nt

BorderPanel()BorderPanel()BorderPanel()BorderPanel()c learscree n()insets()pai nt()setImage()...

BorderPanelborder : intimgw : intimgh : int

BorderPanel()BorderPanel()BorderPanel()BorderPanel()clearscreen()insets()paint()setImage()setImageSize()update()

Movie(from VODServer)ServerSelect

ServerSelect()button1_actionPerformed()button2_actionPerformed()jbInit()textField1_actionPerformed()

-this$0

-this$0-this$0

panel1

lab el 1label2

bevelPanel1

bevelPanel2

label4

bevelPanel1

bevelPanel2

ListFrame

ListFrame()buttonControl1_actionPerforme. ..buttonControl2_actionPerforme. ..buttonControl3_actionPerforme. ..buttonControl4_actionPerforme. ..changeserver()

listframe

serverselect

Socket(from net)

DataInputStream(from io)

ServerReq()connect()connect()disconnect()gethost()getmovie()getmovielist()terminateConnection()isConnected()

server

sock

i nstre am

DataOutputStream(from io)

outstream

Client(f rom VODServer)

l istf rame

Sequ en ce Heade rho rizon ta l_size : in tverti cal_size : in tmb_wi dth : intmb_he ight : i nt

GOPHeaderdro p_fram e_f lag : bo ol e. ..tim e_cod e_ ho urs : in ttim e_cod e_ minute s : in tma rker_bit : boo lean

forward_r_size : intforward_f : intful l_pel_backward_vector : booleanbackward_f_code : intbackward_r_size : intbackward_f : intextra_bit_picture : booleanextra_information_picture : int

PictureHeader()

Da taStore ()MB Ainc()change _q uan tie rscal e()cle arbl ock()cle arprevdispt ime()de code bl ock()exchan ge Iframe ()exchan ge Pfra me()exchan ge fra me()ge tMBA()ge tbackward _r_size()ge tblock()ge tfo rward_r_size()ge tfu ll_pel_ ba ckward _vector()ge tfu ll_pel_ fo rward_ ve cto r()ge tmacro bl ock_typ e()ge tpicture _codin g_type ()ge tqua nt_scal e()ne wf rame ()ne wslice()ne wsqu en ce ()resetMBA ()resetpa std ct ()

screen

picture

gop

he ad er

GOPnu mofpic : inttype : i ntTIME : in t = 0FRAME : int = 1

GOP()clearnumofpi c()ge tnum ofpic()read_g op ()setst ream()

go p

headersto re

store

store

in

GUI

Panel(from awt)

ImageButtonwid th : inthei ght : in tt yp e : int

ScreenPanel

Frame(from awt)

Color(from awt)

col1

col2

De tai lLi sten er1

Detai lListener1()actionPerformed()

Label(from awt)

But ton(from awt) IDCT

IDCT()fast_fidct64_rowcol()

Frame(from awt)

FrameImageF I ()Imag eB utto n

BorderPanelborder : intimgw : intimgh : int

BorderPanel()BorderPanel()BorderPanel()BorderPanel()clearscreen()insets()paint()setImage()setImageSize()update()

col1col2

Label(from awt)

Detail

Detai l()but ton1 _a ctionPerf ormed...jbInit()setmovi e()

-this$0label5

label1label2

label3

bu tto n1

hostreset()jbInit()

bevelPanel1

bevelPanel2

l ab el 1

detail

pe l_aspect_ra tio : intpi ctu re_rate : flo atpi ctu re_f req uency : i ntbi t_rate : intmarker_bit : boo leanvbv_bu ffe r_ si ze : i ntconstra ined_p aram eter_f lag : bo olea nload_i ntra_qu an ti zer_ma tri x : boolean...

tim e_cod e_ se cond s : in ttim e_cod e_ pi ctu re s : in tclo se d_ gop : booleanbro ke n_li nk : b oole an

GOPHe ader()

resetpa std ct ()setgo ph eader()setmacrohead er()setno ni nt ra()setpi ctu re he ad er()setratecontrol()setsequ en ce hea de r()showIfram e()showPframe ()showfra me()ski pb lock()sta rtn ewp icture()

sequence

frame

current

store

Bl ockBl k()

store

D t

Thread(from lang)

Note: Time and PlayTimer are not used by program

Panel(from awt)

Image( from awt)

Bo rderLayout(from awt)

Image( from awt)

ypborder : in tdown : bo ol ea nenab le : b oole anNONE : in t = 1TOGGL E : i nt = 2CL ICK : in t = 3CT OGGLE : in t = 4

Imag eBut ton()Imag eBut ton()Imag eBut ton()Imag eBut ton()check()get Image ()getLabel()i sE na bl ed ()minimumSi ze ()mo useDown ()mo useUp()pai nt ()pai ntAl l()pre fe rredSize()

i t()

im2

im1

Component(from awt)

Time

Time()run()

PlayTimer

Pla yTime r()run ()sto pti me()

Label(from awt)

timer timer

imgw : intimgh : int

ScreenPanel()clearscreen()drawBar()jbInit()paint()setImage()setImageSize()update()

scree nimg

borderL ayout1

Act ionL istener

(from event)

CONSTpicture_start_cod e : int = 256slice_start_cod e_start : i nt = 257slice_start_cod e_end : i nt = 43 1use r_data_start_code : i nt = 434seq uence_hea der_ co de : int = 435seq uence_erro r_code : int = 436exten sion_start_code : i nt = 43 7reserved3 : int = 43 8seq uence end code : int = 43 9

fast_idct64_rowcol()fidct_col()fidct_row()iidct_col()iidct_row()

Image(from awt)

FrameImage()addblock()average()chrom_average()exchangepicture()getIImage()getImage()getImage()getPImage()newsequence()recon()recon_chrom()recon_chrom_down()recon_chrom_right()recon_chrom_rightdown()recon_down()recon_right()recon_rightdown()reconstruct()startnewpicture()

idct

currentImg

CONST see ms a n ob solete el ement

Imag eB utto n seems to be ob solete

ScreenPanel seems to be obsolete

BlockHeaderdc_dct_pred[] : int

BlockHeader()

Blo ck()getDCchrom ()getDClum ()get interblock()get intrablock()rea d_bl ock()setstrea m()

he ad er

Data

Data

(from lang)

Canvas(from awt)

rep ai nt()setBu tton()setEn able ()set Imag e1()set Imag e2()setLa be l()upda te()

Color(from awt)

col2col1

q _ _gro up_start_ co de : int = 440system_start_cod e_start : i nt = 441system_start_cod e_end : int = 51 1...

4

Page 5: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Why Software Architecture?

Business Logic

Streamer

GUI

D tData

5

Page 6: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What is a Software System?

E ft t h t t d b h i Every software system has a structure and behavior=> Every software system has an architecture Structure and Behavior is reflection of System requirements y qand Trade-offs made to satisfy themy

Every software system is build of - components and connectors- glue

6

But what is a component, connector, style?

Page 7: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Possible Trade-Off Factors

Qualities Compatibility with legacy software

Planning for reuse Planning for reuse Distribution profile Potential for changes to Processing algorithmsProcessing algorithms Data representation Structure/functionality Structure/functionality

7

Page 8: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Goals of Presentation

Define key termsDefine key terms Architecture

C t Component Connector Configuration/Topology (Styles)

Understand ways architectures can be Understand ways architectures can be used to help SW development

8

Page 9: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture?

IEEE Standard Glossary of Software E i i T i l [IEEE Std 610 12Engineering Terminology [IEEE Std 610.12-1990] Organizational structure of a system or component

IEEE Recommended Practice for Architectural Description of Software-Intensive Systems [IEEE Std 1471-2000] Fundamental organization of a system embodied in

• Its components• Relationships among the components• Relationships among the components• Relationships to the environment (!) • Principles guiding its design & evolution (!)

9

Code? Design?

Page 10: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

“Foundations for the Study of SoftwareFoundations for the Study of Software Architectures” [Perry & Wolf 92]

Software Architecture ={ Elements, Form, Rationale }

What How Why

Analogy: words grammar meaningAnalogy: words, grammar, meaning

10

Page 11: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

Software Architecture ={ Elements, Form, Rationale }{ , , }

Highest level concept of a system in its environmentenvironment

• Description of elements from which systems are built• Interactions among those elements• Interactions among those elements• Patterns that guide their composition• Constraints on these patterns• Constraints on these patterns

Provides basis for Software Engineering

11

Page 12: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

Software Architectures [Shaw & Garlan 96][ ]defines for a system Computation components Interactions among

t• Clients• Servers• Databases

components• Subprogram calls• Shared dataDatabases

• Filters• Layers

• Client–server• DB–accessing

protocolsprotocols• Asynchronous event

multicastPi d t• Piped streams

• etc.

12

Page 13: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

Shaw & Garlan (cont )Shaw & Garlan (cont.) [A level of design that] involves

• Description of elements from which systems are built

• Interactions among those elements• Patterns that guide their composition• Patterns that guide their composition• Constraints on these patterns

13

Page 14: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

KruchtenKruchten Design & implementation of high-level

structure of softwarestructure of software Involves

• Abstraction (Analogy: city map versus city)• Decomposition• Composition• StyleStyle• Aesthetics

14

Page 15: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What’s A Software Architecture? (cont.)

RUP 2002RUP 2002 Highest level concept of a system in its

i tenvironment

Organization or structure of system'sOrganization or structure of system s significant components

I t ti th h i t f Interacting through interfaces

With components composed of successivelyWith components composed of successively smaller components & interfaces

15

Page 16: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Architectures Are Used To

Specify solution to problemSpecify solution to problem Designing a system that meets requirements

M ki t d ff t ti f i t Making trade-offs to satisfy requirements Analyze solutiony Understanding system-level concerns

(properties) & goal & -ilities(properties) & goal & ilities Manage software complexity

i l l i e.g. canonical solutions

16

Page 17: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Focus Of Software Architectures

System structureSystem structure

Components + interactions + rules of Components + interactions + rules of composition

l f b h i+ rules of behavior Correspondence between requirements &Correspondence between requirements &

implementation

Context in Environment

17

Page 18: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Focus Of SW Architectures (cont.)

Framework for understanding system-level g yconcerns Global rates of flow Communication patterns Execution control structure

S Scalability Paths of system evolution

C it Capacity Throughput Consistency Consistency Component compatibility

18

Page 19: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Why Architectures?

Key to reducing development costsy g p Explicit system structure (divide and conquer) Component-based development philosophy

Separation of concerns Computation from communication (!) Architecture from implementation (!)

Natural evolution of design abstractions for large, complex systems Structure & interaction details overshadow choice of

l ith & d t t talgorithms & data structures

19

Page 20: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Confused about Terminology?

ConnectorConnector Communication, dependency, relationship,

link call interactionlink, call, interaction, … Component Functionality, class, system, subsystem,

legacy system, client, server, filter … Style

Topology pattern composition rules form Topology, pattern, composition rules, form, …Different terms with similar meaning – but many subtleties

20

meaning – but many subtleties

Page 21: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Benefits Of Explicit Architectures

Framework for satisfying requirementsy g q Technical Basis for Design Design Consistency analysis Dependency analysis Dependency analysis Reuse

Managerial basis for Managerial basis for Cost estimation

P t Process management

21

Page 22: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Key Architectural Concepts

Componentp Unit used as a part of some system Locus of computation and state

Connector Element that models

• Interactions among components • Rules that govern those interactions

Configuration Configuration Connected graph of components & connectors which

describes architectural structuredescribes architectural structure

22

Page 23: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Definitions of Architectural Style

Recurring organizational patterns & idiomsRecurring organizational patterns & idioms Established, shared understanding of

common design formscommon design forms Mark of mature engineering field.

S & G• Shaw & Garlan

Abstraction of recurring composition & g pinteraction characteristics in a set of architecturesarchitectures

• Taylor

23

Page 24: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Definitions of Architectural Style (cont.)

Styles are key design idioms that enableStyles are key design idioms that enable

Exploitation of suitable structural & evolutionExploitation of suitable structural & evolution patterns

Facilitate component, connector, & process reusereuse

• Medvidovic

24

Page 25: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Categories of Styles

Idioms & patterns Deal with global organizational structures Possibly application-domain independent To be discussed todayy

Pipe and filter Client-server

Bl kb d Blackboard Layered Reference models Reference models

Specific configurations for certain application areas May be effective outside their initial domains

Di d i l Discussed previously Canonical compiler architecture Other DSSAs

25

Ot e SS s

Page 26: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Basic Properties of Styles

A vocabulary of design elementsC t d t t Component and connector types

e.g., pipes, filters, objects, servers A set of configuration rulesg

Topological constraints that determine allowed compositions of elements

e.g., a component may be connected to at most two other g , p ycomponents

A semantic interpretation Compositions of design elements have well-defined meaningsCompositions of design elements have well defined meanings

Possible analyses of systems built in a style Code generation is a special kind of analysis

26

Page 27: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Benefits of Using Styles

Design reuse W ll d t d l ti li d t bl Well-understood solutions applied to new problems

Code reuse Shared implementations of invariant aspects of a stylep p y

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

Interoperability Interoperability Supported by style standardization e.g., CORBA, JavaBeans

Style-specific analyses Enabled by the constrained design space

Visualizations Visualizations Style-specific depictions matching engineers’ mental models

27

Page 28: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Style Analysis Dimensions

What is the design vocabulary?g y Component and connector types

What are the allowable structural patterns?p What is the underlying computational model? What are the essential invariants of the style?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 (dis)advantages of using the style? What are the style’s specializations?

28

Page 29: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Some Common Architectural Styles

“Basic” styles Pipe and filter Object-oriented Layeredy Blackboard State transition Client-server Client server

• Many flavors [fielding99] Peer-to-peer

• Event-based (a k a Implicit invocation)• Event-based (a.k.a. Implicit invocation)• Push-based

“Derived” stylesG V GenVoca

C2 Rest

29

Page 30: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Pipe and Filter Style

Components are filtersComponents are filters Transform input data streams into output data streams Possibly incremental production of output

C t i Connectors are pipes Conduits for data streams

Input CircularShift Alphabetizer OutputInput

MediumOutputMedium

Style invariants Filters are independent (no shared state) Filter has no knowledge of up- and down-stream filters

ExamplesUNIX shell signal processing

30

UNIX shell signal processingDistributed systems parallel programming

Page 31: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Pipe and Filter (cont.)

Variations Pipelines linear sequences of filters Pipelines — linear sequences of filters Bounded pipes — limited amount of data on a pipe Typed pipes — data strongly typed Batch sequential — data streams are not incremental Batch sequential — data streams are not incremental

Advantages System.Behavior = Component.Behavior

Filt dditi l t d Filter addition, replacement, and reuse• Possible to hook any two filters together

Certain analyses Throughput latency deadlock Throughput, latency, deadlock

Concurrent execution Disadvantages

Batch organization of processing Batch organization of processing Interactive applications Lowest common denominator on data transmission

31

Page 32: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Object-Oriented Style

Components are objectsD t d i t d ti Data and associated operations

Connectors are messages and method invocations Style invariantsStyle invariants

Objects are responsible for their internal representation integrity Internal representation is hidden from other objects

Advantages Advantages “Infinite malleability” of object internals System decomposition into sets of interacting agents

Disadvantages Objects must know identities of servers Side effects in object method invocationsSide effects in object method invocations

32

Page 33: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Layered Style

Hierarchical system organization “Multi-level client-server” Each layer exports an “API” to be used by

above layers

L1

L2

L3above layers Each layer acts as a

Server: service provider to layers “above”

L3

p y Client: service consumer from layers

“below”Connectors are protocols of layer L1

Connectors are protocols of layer interaction

Example: operating systems

L2L3

Example: operating systems Virtual machine style results from fully

opaque layers

33

p q y

Page 34: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Layered Style (cont.)

AdvantagesAdvantages Increasing abstraction levels Evolvability

Changes in a layer affect at most the adjacent two layers Changes in a layer affect at most the adjacent two layers Reuse

Different implementations of layer are allowed as long as p y ginterface is preserved

Standardized layer interfaces (e.g., X window system protocols)protocols)

Disadvantages Not universally applicable

P f Performance Layers may have to be skipped

Determining the correct abstraction level

34

g

Page 35: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Blackboard Style

Two kinds of componentsTwo kinds of components Central data structure — blackboard Components operating on the blackboard

System control is entirely driven by the blackboard state System control is entirely driven by the blackboard state Examples

Typically used for AI systems Integrated software environments (e.g., Interlisp) Compiler architecture

Lexer Parser Semantor

BLACKBOARD

35

Page 36: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

State-Transition Style

Components represent (sets of) system states

Connectors are (sets of) named state transitions

s1s2

s3

t12 t23t32t31

state transitions Disadvantage

Even trivial systems have enormous s4t14a

t42

Even trivial systems have enormous state spaces

Remedy

s4t14b

Abstract away states into coarser-grained components

e g StateCharts/StateMate e.g., StateCharts/StateMate

36

Page 37: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Client-Server Style

Instance of a more general styleg y Distributed systems

Components are clients and servers Components are clients and servers Servers do not know number or identities of

clientsclients Clients know server’s identity Connectors are RPC-based interaction protocols A number of different flavors of client-server

37

Page 38: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Implicit Invocation Style

Event announcement instead of method i tiinvocation “Listeners” register interest in & associate methods

with eventswith events System invokes all registered methods implicitly

Component interfaces are methods and eventsp Two types of connectors Invocation is either explicit or implicit in response to

tevents Style invariants

“Announcers” are unaware of their events’ effects if Announcers are unaware of their events effects, if any

No assumption about processing in response to

38

p p g pevents

Page 39: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Implicit Invocation (cont.)

Advantagesg Component reuse System evolution

• Both at system construction-time & run-time

Disadvantages Counter-intuitive system structure Components relinquish computation control to the

systemsystem No knowledge of what component(s) will respond to

event No knowledge of order of responses Analysis via pre- & post-conditions is difficult

39

Page 40: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Push-Based and Pull-Based Styles

In a “push” system the consumer does not request the product to be developed; it is “pushed” to the end userproduct to be developed; it is pushed to the end-user by promotion. An example of this is a perfume product. Women do not request to smell a fragrance they never

ll d b f it i i l “ h d” t th th h thsmelled before; it is simply “pushed” to them, through the right advertisement.

In a “pull” system the consumer requests the product and “pulls” it through the delivery channel. An example of this is the car manufacturing company Ford Australiathis is the car manufacturing company Ford Australia. Ford Australia only produces cars when they have been ordered by the customers.

Info taken from Wikipedia

40

p

Page 41: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Pull-Based Style

Consumer ProducerRequest

Reply

Examples Web (HTTP Pull)

41

Classical method invocation Client Server

Page 42: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Simple Push-Based Style

Consumer ProducerAnnounce

Publish

42

Page 43: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Push-Based Style

Consumer Producer

Subscribe

ReceiveP bli h

AnnouncePushInfra-

structureUnsubscribe

Publishstructure

Examples employee information systems

43

maintenance manuals stock ticker

Page 44: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Push-Based Style (cont.)

“Components”P d Producer

Receiver Channel Broadcaster Transport system

• Repeater, cache, proxy• Transparent to all other components

Asymmetric communication model Producers ReceiversProducers Receivers Typically fewer producers; but more consumers per producer

than event-based style Relatively tight coupling between source and receiver via Relatively tight coupling between source and receiver via

subscribed channels

44

Page 45: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Push-Based Style (cont.)

AdvantagesAdvantages Communication flexibility

Via repeaters caches proxies• Via repeaters, caches, proxies Back-channels ~ peer-to-peer

Disadvantages Relatively tight coupling between producer &Relatively tight coupling between producer &

consumer via subscribed channels Many system don’t fit model Many system don t fit model

45

Page 46: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Heterogeneous Styles

L1L2L3s1

s2s3

t12 t23t32

t31

FIFOQueue

ProcCallss3t31Queue Calls

I/I Subscribe

BLACKBOARD Push

46

Page 47: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Observations

Different styles result inDiff t hit t Different architectures

Architectures with greatly differing properties No style does fully specifies architecturey y p

Single style can result in different architectures Considerable room for

• Individual judgmentIndividual judgment• Variations among architects• Different emphases

– e.g. imposed by customer

Style defines domain of discourse About problem (domain) About resulting system About resulting system Different architectures lead architects to ask different questions

47

Page 48: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Open Issues

Use of styles is generally ad-hocy g y Difficult to Delimit system aspects that can/should be specified y p p

by a style Compare styles based on their properties Relate systems developed in different styles Select appropriate style(s) for given problem

U l h i ti t l b t Unclear how existing styles can be most effectively combined to produce new styleWh t i t l ti b t d i & What is exact relation between domains & styles?

48

Page 49: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Which systems have an architecture?

?

49

Page 50: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Component Goals

Frequent system goals includeq y g Easy maintenance

• Easy replacement of parts Easy optimization High reliability

Hi h it High security To achieve such goals

C t ’ i t f h ld b ll d fi d Components’ interfaces should be well defined Implementation of components should be hidden

Dependence on other components should be minimal Dependence on other components should be minimal

Page 51: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Simple & Composite Component

Components may be simple or composite Parts of “Simple” components are different level of

abstraction– Heart & Cells (cell is not a heart, also used to build other organs)

Screw & Molecules/Atoms– Screw & Molecules/Atoms– Class & Data & Operations

“Composite” component has parts that are the same Composite component has parts that are the same level of abstraction

– Body & Organ (e.g. heart)y g ( g )– Car & Engine; – Process & Thread

Based on simple and complex components• Based on simple and complex components– “System of Systems” (what is a system? what is a component?)

Page 52: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Connectors

A connector is an architectural element that models A connector is an architectural element that models Interactions among components Rules that govern those interactionsg

Simple interactions Procedure calls Shared variable access

Complex & semantically rich interactions Network protocol Network protocol Client-server protocols

• what rule governs this interaction?Wh t d th k b t th li t? R t i t d• What does the server know about the client? Restricted communication!

Database access protocols Asynchronous event multicast Piped data streams

Page 53: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Configurations/Topologies

Architectural configuration or topology Architectural configuration or topology Describes architectural structure

• Proper connectivity• Concurrent & distributed properties• Adherence to design heuristics & style rules• client-server has a well-defined configuration (server-server connector)

R t d b t d h f t & t Represented by connected graph of components & connectors Each composite component has a configuration

A C2C1

C3 C4 C5B C

D C7C6D C7C6

Page 54: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Example Architecture — Video Game

C lock C hute W ell PaletteStatusC lockLogic

C huteA DT

W ellAD T

PaletteA DT

Relative PosLogic

Tile MatchL i

Next TilePlacing Logic

StatusA DT

StatusLogic

LogicLogicPlacing Logic

g

PaletteA rt istStatus

A rtistWell

Art istC huteArtist

TileA rtist

ManagerLayout

Manager

GraphicsBinding

Page 55: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Coupling and Cohesion

What do architectures accomplish in terms of coupling and What do architectures accomplish in terms of coupling and cohesion?

Page 56: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

What Are Software Architectures Used What Are Software Architectures Used for?

RepresentationS SDesign Process SupportAnalysis

StaticDynamic

EvolutionRefinement

Specification-TimeExecution-TimeRefinement

TraceabilitySi l ti /E t bilit

Execution-Time

Simulation/Executability

Page 57: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Representation

Principal problemsp p Aid stakeholder communication & understanding

Desired solutions Desired solutions Multiple perspectives

Achievable via Achievable via Graphical notations

E li it fi ti d li Explicit configuration modeling Additional views: control flow, data flow, process,

resource utilizationresource utilization

Page 58: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Design Process Support

Principal problemsp p Design collaborating collection of components for

large, distributed, heterogeneous systems Desired solutions Multiple perspectives Design guidance & rationale

Achievable via Active support for specification

• Proactive vs. Reactive• Non-intrusive vs Intrusive• Non-intrusive vs. Intrusive

Page 59: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Static Analysis

Principal problemsE l t t ti l Evaluate system properties early

• Reduce number & cost of errors Architecture is analyzed without executing it

Desired solutions Internal consistency Concurrent & distributed propertiesConcurrent & distributed properties Design heuristics & style rules

Achievable viaParsers compilers model checkers Parsers, compilers, model checkers

Schedulability & resource utilization analyzers Design critics

Mi h l i Mismatch analysis

Page 60: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Dynamic Analysis

Principal problems Same as static analysis Architecture is analyzed during execution How do you execute an architecture?How do you execute an architecture?

Desired solutions Testing & debugging Assertion checking Specification & checking of important runtime properties

Achievable via Achievable via Scenarios Simulation Event visualization & filtering

Page 61: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Specification-Time Evolution

Principal problems Evolution of design elements, systems, and system

families Desired solutions Desired solutions Architectural equivalent of subtyping/refinement Architectural configuration managementArchitectural configuration management Incremental specification system families

Achievable via Heterogeneous, flexible subtyping mechanisms Explicit & flexible connectors

E li it ifi ti f li ti f il Explicit specification of application family

Page 62: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Execution-Time Evolution

Principal problems Same as specification-time evolution Must be accomplished during system execution

Desirable solutions Desirable solutions Replication, insertion, removal, reconnection, migration Planned or unplanned Constraint satisfaction

Achievable viaC t i d & t i d (“ ”) d i Constrained & unconstrained (“pure”) dynamism

Conditional configuration Replicationp Analysis of architecture during system modification

Page 63: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Refinement

Principal problems p p Bridge gap between informal diagrams &

programming languages Desired solutions Specify architectures at different abstraction levelsSpecify architectures at different abstraction levels Correct & consistent refinement across levels

Achievable via Achievable via Correctness-preserving mappings

Comparative simulations Comparative simulations

Page 64: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Traceability

Principal problemsp p Multiple abstraction levels + multiple perspectives

Desired solutions Desired solutions Traceability across architectural cross-sections

Achievable via Achievable via Well established relationships among architectural

perspectivesperspectives Mapping from requirements to architecture

Page 65: SWE-JKU-Lecture07 - Architecture and Design - How to Get There

Simulation/Executability

Principal problems Checking dynamic properties requires g y p p q

running system Early prototypes needed to

demonstrate features to stakeholders A

Desired solutions Construct simulations

I Systematic support for system generation

Achievable via

I

Achievable via Simulating event sequences Restricting implementation space