6- Software Architecture

42
7/23/2019 6- Software Architecture http://slidepdf.com/reader/full/6-software-architecture 1/42 What Is Software Architecture? IEEE 1471-2000  Software architecture is the fundamental organization of a system, embodied in its components, their relationships to each other and the enironment, and the principles !oernin! its desi!n and eo"ution #rom$www%r!oarchitects%com

Transcript of 6- Software Architecture

Page 1: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 1/42

What Is SoftwareArchitecture?

IEEE 1471-2000 Software architecture is the fundamental organization of a system, embodied in itscomponents, their relationships to eachother and the enironment, and theprinciples !oernin! its desi!n andeo"ution

#rom$www%r!oarchitects%com

Page 2: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 2/42

What Is SoftwareArchitecture?

Software architecture encom&asses the setof si!ni'cant decisions about theor!ani(ation of a software system

 – Se"ection of the structura" e"ements and their

interfaces by which a system is com&osed – )ehaior as s&eci'ed in co""aborations

amon! those e"ements

 – *om&osition of these structura" and

behaiora" e"ements into "ar!er subsystems – Architectura" sty"e that !uides this

or!ani(ation#rom$www%r!oarchitects%com

Page 3: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 3/42

What Is SoftwareArchitecture?

)oehm et a"%, 1++ – A software system architecture com&rises

• A co""ection of software and system com&onents, connections, and constraints

• A co""ection of system staeho"ders. need statements

• A rationa"e which demonstrates that the com&onents, connections, and

constraints de'ne a system that, if im&"emented, wou"d satisfy the co""ection ofsystem staeho"ders. need statements

*"ements et a"%, 1++7 – /he software architecture of a &ro!ram or com&utin! system is thestructure or structures of the system, which com&rise softwarecom&onents, the eterna""y isib"e &ro&erties of those com&onents, and the

re"ationshi&s amon! them

#rom$www%r!oarchitects%com

Page 4: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 4/42

What Is SoftwareArchitecture?

/he hi!hest-"ee" breadown of asystem into its &arts the decisionsthat are hard to chan!e there aremu"ti&"e architectures in a systemwhat is architectura""y si!ni'cant canchan!e oer a system.s "ifetime and,

in the end, architecture boi"s down towhateer the Im&ortant stu3 is%

5atterns of Enter&rise A&&"ication Architecture, 6artin #ow"er

Page 5: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 5/42

Architecture #irst

Architecture represents the set of

earliest design decisionsHardest to change

Most critical to get right

Architecture is the rst design artifact

where a system’s quality attributes areaddressed

#rom$www%r!oarchitects%com

Page 6: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 6/42

Architecture s% esi!n

non-functiona"

re8uirements9i"ities:

functiona"

re8uirements9domains:

Important : this is a general guideline – sometimes the borders are

blurredS"ide #rom$ www%r oarchitects%com

Architecture$ where non-functiona" decisions are cast,and functiona" re8uirements are &artitioned

esi!n$ where functiona" re8uirements areaccom&"ished

architecture

desi!n

Page 7: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 7/42

Software Architectures for;41

#or the &ur&oses of this course we wi"""imit your choice of architectures totwo that are we"" suited to bui"din!web so"utions%

1% 6ode"-<iew-*ontro""er 96<*:

2% Web Enter&rise Architecture 9WEA:

Page 8: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 8/42

6<*

 

 /he so"id "ine re&resents a direct association, the dashed anindirect association 9ia an obserer for eam&"e:%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode">>

Page 9: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 9/42

6<*• Model–View–Controller 9MVC: is a software

architecture, current"y considered an architectura"&attern used in software en!ineerin!% /he &atterniso"ates domain "o!ic 9the a&&"ication "o!ic for theuser: from the user interface 9in&ut and &resentation:,

&ermittin! inde&endent dee"o&ment, testin! andmaintenance of each 9se&aration of concerns:%

•  /he model mana!es the behaior and data of thea&&"ication domain, res&onds to re8uests for

information about its state 9usua""y from the iew:, andres&onds to instructions to chan!e state 9usua""y fromthe contro""er:% In eent-drien systems, the mode"noti'es obserers 9usua""y iews: when theinformation chan!es so that they can react%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 10: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 10/42

6<*

•  /he iew renders the mode" into a form suitab"efor interaction, ty&ica""y a user interfacee"ement% 6u"ti&"e iews can eist for a sin!"emode" for di3erent &ur&oses% A iew&ortty&ica""y has a one to one corres&ondence witha dis&"ay surface and nows how to render to it%

•  /he controller receies in&ut and initiates ares&onse by main! ca""s on mode" ob@ects% Acontro""er acce&ts in&ut from the user andinstructs the mode" and iew&ort to &erformactions based on that in&ut%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 11: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 11/42

6<*

• An MVC a&&"ication may be a co""ection ofmode"=iew=contro""er triads, each res&onsib"e for adi3erent I e"ement% /he Swin! BI system, for eam&"e,mode"s a"most a"" interface com&onents as indiidua" 6<*systems%

• 6<* is often seen in web a&&"ications where the iew is theC/6D or C/6D !enerated by the a&&% /he contro""erreceies BE/ or 5FS/ in&ut and decides what to do with it,handin! oer to domain ob@ects 9i%e% the mode": which

contain the business ru"es and now how to carry outs&eci'c tass such as &rocessin! a new subscri&tion, andwhich hand contro" to 9:C/6D-!eneratin! com&onentssuch as tem&"atin! en!ines, 6D &i&e"ines, A@a ca""bacs,etc%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 12: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 12/42

6<*

 /he .mode". in 6<* is both the data and thebusiness=domain "o!ic needed to mani&u"ate the datain the a&&"ication% 6any a&&"ications use a &ersistentstora!e mechanism such as a database to store data%

6<* does not s&eci'ca""y mention the data access"ayer because it is understood to be underneath orenca&su"ated by the mode"% 6ode"s are not dataaccess ob@ects howeer, in ery sim&"e a&&s thathae "itt"e domain "o!ic there is no rea" distinction to

be made% Actie Gecord is an acce&ted desi!n &atternwhich mer!es domain "o!ic and data access code - amode" which nows how to &ersist itse"f%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 13: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 13/42

6<*!eriew

 /hou!h 6<* comes in di3erent Haors, contro" How is !enera""y as fo""ows$

1% /he user interacts with the user interface in some way% 9for eam&"e,&resses a mouse button:%

2% /he contro""er hand"es the in&ut eent from the user interface, often iaa re!istered hand"er or ca""bac and conerts the eent into a&&ro&riate

user action, understandab"e for the mode"%;% /he contro""er noti'es the mode" of the user action, &ossib"y resu"tin! in

a chan!e in the mode".s state% 9#or eam&"e, the contro""er u&dates theuser.s sho&&in! cart%:

4% A iew 8ueries the mode" in order to !enerate an a&&ro&riate userinterface 9for eam&"e, the iew "ists the sho&&in! cart.s contents:% /he

iew !ets its own data from the mode"% In some im&"ementations, thecontro""er may issue a !enera" instruction to the iew to render itse"f% Inothers, the iew is automatica""y noti'ed by the mode" of chan!es instate 9Fbserer: which re8uire a screen u&date%

% /he user interface waits for further user interactions, which restarts thecyc"e%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 14: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 14/42

6<* in aa EE

 "aa# "aa $latform% &nterprise &dition '"aa &&(Sim&"e <ersion im&"ementin! aa Ser"ets and aaSerer 5a!es from aaEE$

• 6ode" /his is the a&&"icationJs business "ayer and is usua""y made u& ofthe ob@ects that re&resent the business entities that mae u& thea&&"ication% /he mode" is a co""ection of aa c"asses that form a software

a&&"ication intended to store, and o&tiona""y se&arate, data% A sin!"efront end c"ass that can communicate with any user interface 9foream&"e$ a conso"e, a !ra&hica" user interface, or a web a&&"ication:%

• <iew /he iew is re&resented by a aaSerer 5a!e, with data bein!trans&orted to the &a!e in the Ctt&Ser"etGe8uest or Ctt&Session%

• *ontro""er /he *ontro""er ser"et communicates with the front end of themode" and "oads the Ctt&Ser"etGe8uest or Ctt&Session with a&&ro&riatedata, before forwardin! the Ctt&Ser"etGe8uest and Ges&onse to the S5usin! a Ge8uestis&atcher%

•  /he Ser"et is a aa c"ass, and it communicates and interacts with themode", but does not need to !enerate C/6D or C/6D out&ut the S5s donot hae to communicate with the mode" because the Ser"et &roidesthem with the informationKthey can concentrate on creatin! out&ut%

 /aen in entirety from$ htt&$==en%wii&edia%or!= wii=6ode"><iew>*ontro""er

Page 15: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 15/42

6<*

6<* architecture is the base for a

number of commercia" and o&ensource framewors and is inc"uded inthe a""owab"e architectures for ;41 in

&art to &ermit the use of theseframewors in dee"o&in! youra&&"ication%

Page 16: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 16/42

WEA

Web Enter&rise Architectures aredesi!ned to hand"e the "ar!eo"umes of traLc e&ected of a

business in a robust and re"iab"emanner%

 /he WEA mode" is a "ayered

Architecture com&osed of ; main"ayers 9thou!h each main "ayer maybe sub-diided into 2 or more sub-

"ayers:

Page 17: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 17/42

WEA

 /he main "ayers of a WEA are$

• 5resentation

Do!ic 9aa omain or omain Do!ic:• Serices 9aa /echnica" Serices or

een as the ata Access "ayer whereno other serices are contem&"ated:

Page 18: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 18/42

WEA

As a Dayered Architecture we wou"de&ect any &articu"ar "ayer of a WEAto communicate on"y with those

"ayers direct"y aboe or be"ow it%

 /his is indeed the case% Ce&resentation "ayer has direct

communication on"y with the "o!ic"ayer as does the serices "ayer% )nno case should the presentation

layer eer communicate directly

Page 19: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 19/42

WEA

We see then the same se&aration ofconcerns in the WEA that we saw inthe 6<*, but eecuted oer a

"ayered architectura" structure ratherthan sim&"y as connectedcom&onents%

WEA ty&ica""y mae stron! use ofEnter&rise 5atterns to ensure 8ua"ityand maintainabit"y%

9see$ 5atterns of Enter&rise A&&"ication

Page 20: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 20/42

Architectures 5reent S&a!hetti*ode

Whether you use the 6<* or the WEAwe see that in neither case to thearchitectura" &atterns &ermit the

direct access of the mode", "et a"onethe &ersistent stora!e mechanism9database:, by the front end 9<iew or

5resentation Dayer:% Mou shou"d neer a""ow direct access to

your database from the web &a!e

itse"f%

Page 21: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 21/42

4N1 <iew /he 4N1 iew comes from the Gationa" ni'ed

5rocess 9G5: and is com&osed of the "o!ica",&rocess, dee"o&ment, and de&"oyment iew a"on!with the scenarios%

htt&$==en%wii&edia%or!=wii=#i"e$4O2)1PArchitectura"P<iewP6ode"%@&!

Page 22: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 22/42

G5 > 4N1 #rom$www%r!oarchitects%com

Page 23: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 23/42

Do!ica" <iew

Logical view $ /he "o!ica" iew is concernedwith the functiona"ity that the system&roides to end-users% 6D ia!rams used

to re&resent the "o!ica" iew inc"ude *"assdia!ram, *ommunication dia!ram,Se8uence dia!ram%

#or this &ro@ect we wi"" e&ect you to use a

truncated ersion of your esi!n *"assia!ram 9*: inc"udin! on"y thearchitectura""y si!ni'cant c"asses%

Page 24: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 24/42

ee"o&ment <iew

Development view $ /he dee"o&ment iewi""ustrates a system from a &ro!rammer.s&ers&ectie and is concerned with softwaremana!ement% /his iew is a"so nown as theim&"ementation iew% It uses the 6D*om&onent dia!ram to describe systemcom&onents% 6D ia!rams used to re&resentthe dee"o&ment iew inc"ude the 5aca!edia!ram%

#or this &ro@ect we wi"" e&ect you to use acom&onent dia!ram%

Page 25: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 25/42

5rocess <iew

Process view $ /he &rocess iew dea"swith the dynamic as&ects of thesystem, e&"ains the system

&rocesses and how theycommunicate, and focuses on theruntime behaior of the system% /he

&rocess iew addresses concurrency,distribution, inte!rators,&erformance, and sca"abi"ity, etc%

6D ia!rams to re&resent &rocess

Page 26: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 26/42

5hysica" <iew

Physical view $ /he &hysica" iewde&icts the system from a systemen!ineer.s &oint-of-iew% It is

concerned with the to&o"o!y ofsoftware com&onents on the &hysica""ayer, as we"" as communication

between these com&onents% /hisiew is a"so nown as thede&"oyment iew% 6D ia!rams

used to re&resent &hysica" iew

Page 27: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 27/42

Scenarios

Scenarios $ /he descri&tion of an architecture isi""ustrated usin! a sma"" set of use cases, orscenarios which become a 'fth iew% /he scenariosdescribe se8uences of interactions between

ob@ects, and between &rocesses% /hey are used toidentify architectura" e"ements and to i""ustrate anda"idate the architecture desi!n% /hey a"so sere asa startin! &oint for tests of an architecture

&rototy&e% 6D ia!ram9s: used to re&resent thescenario iew inc"ude the se case dia!ram%

Cere you may reuse the * you dee"o&ed as &artof your re8uirements &hase%

Page 28: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 28/42

*"ass ia!ram and *

We wi"" study the correct 6Dde&iction of the desi!n *"assia!ram 9*: in a "ater tutoria"%

#or the 4N1 iew a truncated ersionof the * that inc"udes on"yarchitectura""y si!ni'cant c"asses is

used% /he se *ase ia!ram has been

coered in a ear"ier tutoria"%

Page 29: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 29/42

*om&onent ia!ram

In the ni'ed 6ode"in! Dan!ua!e, acomponent diagram de&icts howcom&onents are wired to!ether to

form "ar!er com&onents and orsoftware systems% /hey are used toi""ustrate the structure of arbitrari"y

com&"e systems%

#rom$ htt&$==en%wii&edia%or!=wii=*om&onentPdia!ram

Page 30: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 30/42

*om&onent ia!ram

• *om&onent dia!rams are com&osed of*om&onents and *onnectors%

*om&onents are wired to!ether by usin! anassembly connector  to connect the re8uiredinterface of one com&onent with the&roided interface of another com&onent%

 /his i""ustrates the service consumer -service provider  re"ationshi& between thetwo com&onents%

htt&$==en%wii&edia%or!=wii=*om&onentPdia!ram

Page 31: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 31/42

*om&onents

• A component in the ni'ed 6ode"in! Dan!ua!ere&resents a modu"ar &art of a system, thatenca&su"ates its content and whosemanifestation is re&"aceab"e within its

enironment% A com&onent de'nes its behaiorin terms of provided and required interfaces%

• A com&onent may be re&"aced by another if andon"y if their &roided and re8uired interfaces are

identica"% /his idea is the under&innin! for the&"u!-and-&"ay ca&abi"ity of com&onent-basedsystems and &romotes software reuse%

htt&$==en%wii&edia%or!=wii=*om&onentPO2R6DO2+

Page 32: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 32/42

Assemb"y *onnectors ShowInterfaces

An assembly connector  is a connectorbetween two com&onents that de'nesthat one com&onent &roides the

serices that another com&onentre8uires% An assemb"y connector is aconnector that is de'ned from are8uired interface or &ort to a &roidedinterface or &ort%

htt&$==en%wii&edia%or!=wii=*om&onentPdia!ram

Page 33: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 33/42

e"e!ation *onnector

A delegation connector  is a connectorthat "ins the eterna" contract of acom&onent 9as s&eci'ed by its &orts:

to the interna" rea"i(ation of thatbehaior by the com&onentJs &arts%

htt&$==en%wii&edia%or!=wii=*om&onentPdia!ram

Page 34: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 34/42

A *om&onent ia!ramhtt&$==en%wii&edia%or!=wii=#i"e$5o"icyPAdminP*om&onentPia!ram%5B

Page 35: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 35/42

*om&onent ia!rams

ote

•  /he interfaces de'ned by the named ba"" and socetconnectors 9assemb"y connector:%

• )a"" - &roides serice

• Socet > uses serice

•  /he dashed arrow for de"e!ation connectors%

•  /he named rectan!u"ar com&onents

#or more information See$

htt&$==www%a!i"emode"in!%com=artifacts=com&onentia!ram%htm

Page 36: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 36/42

Actiity ia!ram

Actiity diagrams are !ra&hica"re&resentations of worHows of ste&wiseactiities and actions with su&&ort for

choice, iteration and concurrency%T1U

 In theni'ed 6ode"in! Dan!ua!e, actiitydia!rams can be used to describe thebusiness and o&erationa" ste&-by-ste&

worHows of com&onents in a system% Anactiity dia!ram shows the oera"" How ofcontro"%

htt&$==en%wii&edia%or!=wii=ActiityPdia!ram

Page 37: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 37/42

Actiity ia!ram

htt&$==en%wii&edia%or!=wii=ActiityPdia!ram

Page 38: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 38/42

Actiity ia!ram• Actiity dia!rams are constructed from a "imited

re&ertoire of sha&es, connected with arrows% /he mostim&ortant sha&e ty&es$

• rounded rectangles re&resent activities

• diamonds re&resent decisions

bars re&resent the start 9split : or end 9 join: of concurrentactiities

• a blac circle re&resents the start 9initial state: of theworHow

• an encircled blac circle re&resents the end 9!nal state:%

• Arrows run from the start towards the end and re&resentthe order in which actiities ha&&en%

• Cence they can be re!arded as a form of Howchart 9withadded notation for concurrency:%

htt&$==en%wii&edia%or!=wii=ActiityPdia!ram

Page 39: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 39/42

e&"oyment ia!ram

A deployment diagram in the ni'ed6ode"in! Dan!ua!e mode"s the physical de&"oyment of artifacts on nodes%  /o describe aweb site, for eam&"e, a de&"oyment dia!ram

wou"d show what hardware com&onents9nodes: eist 9e%!%, a web serer, ana&&"ication serer, and a database serer:, whatsoftware com&onents 9artifacts: run on each

node 9e%!%, web a&&"ication, database:, and howthe di3erent &ieces are connected 9e%!% )*,GES/, G6I:%

htt&$==en%wii&edia%or!=wii=e&"oymentPdia!ram

Page 40: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 40/42

e&"oyment ia!ram

 /he nodes a&&ear as boes, and theartifacts a""ocated to each node a&&earas rectan!"es within the boes% odes

may hae subnodes, which a&&ear asnested boes% A sin!"e node in ade&"oyment dia!ram may conce&tua""y

re&resent mu"ti&"e &hysica" nodes,such as a c"uster of database serers%htt&$==en%wii&edia%or!=wii=e&"oymentPdia!ram

Page 41: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 41/42

e&"oyment ia!ramhtt&$==en%wii&edia%or!=wii=#i"e$e&"oymentPia!ram%5B

Page 42: 6- Software Architecture

7/23/2019 6- Software Architecture

http://slidepdf.com/reader/full/6-software-architecture 42/42

e&"oyment ia!ram

ote$

•  /hat in the &reious s"ides the connectin! "ines,the &rotoco"s were unnamed% /his is incorrect%A"" connectin! &rotoco"s shou"d be named%

•  /he nested com&onents$ hardwarecom&onents, or nodes, and softwarecom&onents ca""ed artifacts%

ote the 6D symbo" for artifact in the u&&erri!ht hand corner of the artifacts and the "ooseand &ermissie namin! conentions for nodes