Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware:...

28
1 15-214 School of Computer Science Architectural Patterns/Styles Charlie Garrod Michael Hilton

Transcript of Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware:...

Page 1: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

115-214

SchoolofComputerScience

ArchitecturalPatterns/Styles

CharlieGarrod MichaelHilton

Page 2: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

215-214

Administrivia

• Homework6checkpoint– MondayDec4th

• FinalExamReview:Dec13th,2-4pmWean5409• FinalExam:Dec15th,5:30-8:30pmWean7500

Page 3: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

315-214

LastTime:

• DesignPatterns

Page 4: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

415-214

ARCHITECTURALPATTERNS/STYLES

Page 5: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

515-214

DesignPatterns

Page 6: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

615-214

ArchitecturalStyles

Page 7: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

715-214

ArchitecturalStyles

Page 8: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

815-214

ArchitecturalStylesvsDesignPatterns

Page 9: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

915-214

MonolithicApplication

+Simpletostart+Simpletodeploy+Fasttimetofirstfeature- Difficultfornewdeveloperstocomeuptospeed- Continuousdeploymentisdifficult- Scalingcanbedifficult- Candevolveinto“bigballofmud”

Page 10: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1015-214

Layers

Page 11: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1115-214

Layers

• Context:– Alargesystemthatrequiresdecomposition

• Problem:– Lowseparationofconcerns.– Partsofsystemarenotinterchangeable– Lackofgroupedcomponentshurtsunderstandabilityandmaintainability– Lackofboundariesmakestaskingdifficult

• Solution:– Definelayersofabstraction– Specifyservicesbetweenboundaries

• Beware:– Antipattern:Sinkhole– Antipattern:Lasagna

Page 12: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1215-214

Pipeandfilter

Page 13: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1315-214

Pipeandfilter

• Context:– Processingdatastream

• Problem:– Needtoprocessortransformastreamofdata– Non-adjacentstepsdon’tshareinformation– Needtoreusecertainstepsintheprocess

• Solution:– Eachfiltertransformsthedata,thenmovesitontothenextstep

• Beware:– ErrorHandling– Datatransformationoverhead

Page 14: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1415-214

Blackboard

Page 15: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1515-214

Blackboard

• Context:– Animmaturedomainwherenoclosedapproachisknowntobefeasible

• Problem:– Acompletesearchofsolutionspaceisnotfeasable– Multiplealgorithmspossiblefordifferentsubtasks– Somealgorithmsworkontheoutputofothers– Uncertaindataandaprox solutionsareinvolved

• Solution:– Independentprogramsworkingcooperativelyoncommondata– Inspectandupdatedata

• Beware:– Difficulttotest– Difficultestablishingagoodcontrolstrategy

Page 16: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1615-214

Model-View-Controller

Page 17: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1715-214

Model-View-Controller

• Context:– InteractiveapplicationswithaflexibleHuman-Computerinterface

• Problem:– Howtodevelopanapplicationnotdependentoninterface– Needabilityforapplicationtosupportdifferentinterfaces– Allowsimultaneousdevelopment

• Solution:– Model– View– Controllerdivision

• Beware:– Codenavigability– Increasedcomplexity

Page 18: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1815-214

Broker

Page 19: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

1915-214

Broker

• Context:– Decoupledcomponentsinteractthroughremoteserviceinvocations

• Problem:– Scalingforlargescalesystems– Componentsshouldbedecoupledanddistributed

• Solution:– Brokersmediatebetweenclientsandservers

• Beware:– Lessefficient– Lowerfaulttolerance

Page 20: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2015-214

Microkernel

Page 21: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2115-214

Microkernel

• Context:– Thedevelopmentofseveralapplicationsthatusesimilarinterfaceson

samecore

• Problem:– Shouldcopewithcontinuoushardwareandsoftwareevolution– Platformshouldbeportable,extensibleandadaptable

• Solution:– Encapsulatefundamentalservicesofyourapplicationplatformina

microkernel– Otherfunctionalityprovidedbyinternalservers

• Beware:– Complexityofdesignandimplementation

Page 22: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2215-214

Event-drivenarchitecture

Page 23: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2315-214

Event-drivenarchitecture

• Context:– Buildingalooselycoupled,moreresponsivesystem

• Problem:– Buildasystemthatreactstoeventsintheworldaroundit– Onlyhavetodecidewhattodo,notwhentodoit

• Solution:– Eventcreators,managers,andconsumers

• Beware:– Securityrisks– Increasedcomplexity

Page 24: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2415-214

Peer-to-peer

Page 25: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2515-214

Peer-to-peer

• Context:– Asystemwhereeachnodehasthesamecapabilitiesandresponsibilities

• Problem:– Asituationwhereitisnotfeasibletoknowaheadoftimewhichnodes

willbeservers– Largeamountsofdataneedtobesenttransmitted

• Solution:– Decentralizedcomputing– Highlyrobustinthefaceofnodefailure– Highlyscalable

• Beware:– Noservertomanagedata– Noalwaysusedforlegalpurposes

Page 26: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2615-214

Service-orientedarchitecture

Page 27: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2715-214

Service-orientedarchitecture

• Context:– Servicesareprovidedtoothercomponentsoveranetwork

• Problem:– Buildingadistributedsystem– Exposeaservicenoobjects

• Solution:– Eachserviceshould:

• Representabusinessactivitywithaspecificoutcome• Beself-contained• Ablack-boxforitsconsumers• Mayconsistofunderlyingservices

• Beware:– Highinvestmentcost

Page 28: Charlie Garrod Michael Hiltoncharlie/courses/15-214/2017-fall/slides/...2017/11/28  · • Beware: –No server to manage data –No always used for legal purposes 15-214 26 Service-oriented

2815-214

Exercise:

• Styles:– Monolith– Layers– PipeandFilter– Blackboard– MVC– Broker– Peer-to-peer– Microkernel– Event-driven– Service-oriented

• Application– Onlinebankingapplication– APIforthirdpartytoolstoget

bankinginformation– Compiler– OpticalCharacterrecognition– VRcontentdeliverysystem– VRgame– Insuranceclaimprocessing

system