1University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 1Lecture 4:Showing the architecture Coupling and Cohesion UML Package Diagrams Software Architectural Styles: Layered Architectures Pipe-and-filter Object Oriented Architecture Implicit Invocation RepositoriesUniversity of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 2Coupling and CohesionArchitectural Building blocks:A good architecture:Minimizes coupling between modules:Goal: modules don’t need to know much about one another to interactLow coupling makes future change easierMaximizes the cohesion of each moduleGoal: the contents of each module are strongly inter-relatedHigh cohesion makes a module easier to understandmodule moduleconnectorX23University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. Conway’s Law“The structure of a software systemreflects the structure of the organisationthat built it”University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 4PeopleSocio-Technical CongruenceCGBEFDALJHIKModules372564112108911See: Valetto, et al., 2007.3University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 5PeopleSocio-Technical CongruenceCGBEFDALJHIKModules372564112108911See: Valetto, et al., 2007.University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 6Software ArchitectureA software architecture defines:the components of the software systemhow the components use each other’s functionality and dataHow control is managed between the componentsAn example: client-serverServers provide some kind of service; clients request and use servicesapplications are located with clientsdata storage is treated as a server4University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 7Application LogicStorage LayerPresentation Layer3-layer architectureJavaAWT ApplicationViews ControlObjects BusinessLogic QueryEngine DBMSFileManagemt University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 8UML PackagesWe need to represent our architecturesUML elements can be grouped together in packagesElements of a package may be: other packages (representing subsystems or modules); classes; models (e.g. use case models, interaction diagrams, statechart diagrams, etc)Each element of a UML model is owned by a single packageCriteria for decomposing a system into packages:Ownershipwho is responsible for working on which diagramsApplicationeach problem has its own obvious partitions;Clusters of classes with strong cohesione.g., course, course description, instructor, student,…Or use an architectural pattern to help find a suitable decomposition5University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 9 javaPackage notationutil util DateDate util java::util Date util Datejava::util::Datenamed packagepackage with listof contained classespackage containinga class diagrampackage with qualified namenested packagespackage with fully qualified nameUniversity of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 10Towards component-based design control Button Check box <<interface>> OnOffturnOn()turnOff()isOn()isOff() Furnace::Heater Lighting::Light6University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 11Or use Component Diagrams… Till Sales Server messagequeue transactionprocessor accountingdriver accountingsystem salesmessageUniversity of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 12Dependency cycles…7University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 13Application Logic Layer PackageStorage Layer PackagePresentation Layer PackageArchitectural PatternsE.g. 3 layerarchitecture:PresentationLayerApplicationLogic LayerStorageLayerJava AWTApplicationWindowsControlObjectsBusinessObjectsObject toRelationalJDBCJava SQLUniversity of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 14Or to show the interfaces…Application Logic Layer PackageStorage Layer PackagePresentation Layer PackageJava AWTApplicationWindowsControlObjectsBusinessObjectsObject toRelationalJDBCJava SQL E.g. 3 layerarchitecture:PresentationLayerApplicationLogic LayerStorageLayer8University of TorontoDepartment of Computer Science© 2008 Steve Easterbrook. This presentation is available free for non-commercial use with attribution under a creative commons license. 15kernalLayered SystemsExamplesOperating Systemscommunication protocolsInteresting propertiesSupport increasing levels of abstraction during designSupport enhancement (add functionality) and re-usecan define standard layer interfacesDisadvantagesMay not be able to identify (clean) layerskernalutilitiesapplication layerusersSource: Adapted from Shaw & Garlan 1996, p25. See also van Vliet, 1999, p281.University of TorontoDepartment of Computer Science© 2008 Steve
View Full Document