Goals of the Lecture UML Implemetatio Diagrams Object-Orieted Aalysis ad Desig - Fall 1998 Preset UML Diagrams useful for implemetatio Provide examples Next Lecture Ð A variety of topics o mappig from desig ito implemetatio traslatig associatios ito operatios, scalability cosideratios, etc. Overview Packages Package Diagrams Ð Systems ad Subsystems Compoet Diagrams Deploymet Diagrams Collaboratios A package is a geeral-purpose mechaism for orgaizig elemets ito groups Ð Packages are redered as tabbed folders Ð The visibility of elemets ca be specified Ð Elemets are sematically related for a sigle purpose Packages are thus coducive to providig groups which are highly cohesive, loosely coupled, ad access tightly cotrolled
Package Example Iformatio o Packages Chimera ChimeraServer Cocept API +csapi +hwsapi +hwmapi -evetgeerator Packages ca cotai Ð packages, classes, iterfaces, compoets, odes, collaboratios, use cases, etc. Cotaimet is a composite relatioship Ð The elemet belogs to the package Delete the package, you delete its elemets More Iformatio o Packages Each package defies a amespace Ð Names of elemets (of a particular type) must be uique withi a package e.g. you ca have a class amed Timer ad a iterface amed Timer but you caõt have two classes both amed Timer Ð its recommeded that you keep all ames uique regardless of type, however Ð Nested ames use the followig otatio Chimera::API::csAPI Accessig Package Elemets ProductIfo + ame + descriptio + image - GUI::Widow GUI + Widow + Form # EvetHadler «access» «import» Cliet + OrderForm + TrackigForm - Order Import ad Access specify that oe package makes use of aother. Import brigs the public elemets of the target package ito the source s amespace. These relatioships are ot trasitive ad oly operate i oe directio.
Geeralizatio Geeralizatio Example GUI Geeralizatio relatioships are used to specify families of packages Ð All rules of iheritace apply Public ad Protected members are available i childre, ad childre ca override members of their parets ad add ew elemets Substitutability ca also be used; a child package ca be used i the place of oe of its parets MacGUI + Widow + Form # EvetHadler WidowsGUI + GUI::Widow + Form + VBForm Stadard Package Stereotypes Systems ad Subsystems facade Ð A package that is a view oto some other package framework Ð A package cosistig maily of patters stub Ð A package that serves as a proxy for the public cotets of aother package system, subsystem A system is the thig beig modeled ad developed to accomplish some task Ð It cotais all its models such as classes, use cases, activity diagrams, etc. A subsystem is simply a part of a system Ð used to decompose a complex system ito early idepedet parts Ð typically has high cohesio collectig everythig eeded to accomplish a particular subtask or goal
Compoets Compoets vs. Classes A compoet is a physical ad replaceable part of a system that coforms to ad provides the realizatio of a set of iterfaces Ð Redered as a rectagle with tabs Example Compoets Ð dyamically-liked libraries, jar files, database tables, software compoets (JavaBeas, CORBA, ad DCOM) Classes are logical abstractios Ð Compoets are physical objects that ca be deployed Classes may have attributes ad operatios Ð Compoets typically oly have operatios defied by their associated iterfaces Compoets are at a differet level of abstractio; they represet the physical packagig of classes Compoets ad Iterfaces More o compoets image.class ImageObserver compoet.class Compoet.class exports the iterface, image.class imports it. A compoet ca import ad export may differet iterfaces. The iterface breaks the depedecy betwee the two compoets; they ca chage idepedetly as log as they maitai their obligatios with respect to the iterface. Compoets are physical Compoets are replaceable Compoets are part of a system Ð They ca be thought of as buildig blocks Compoets coform to ad provide the realizatio of a set of iterfaces
Stadard Compoet Stereotypes Executable Compoet Example executable aimator.class dlog.dll Ð ca be executed o a ode library Ð static or dyamic object library table Ð database table raytrce.dll reder.dll wrfrme.dll file Ð source code or data documet Ð catch-all for other types of documets Deploymet Diagrams Chimera Deploymet Documet the odes of a system A ode is a physical elemet that represets a computatioal resource Ð typically havig memory ad processig capability Ð Nodes model the topology of the hardware used by a system A ode represets (typically) a processor or device (sesor, modem, etc.) achor chimeraserver jimage bigtime hwmserver hwsserver serl mysql
Nodes vs. Compoets More iformatio o Nodes Compoets participate i the executio of a system Ð Nodes are thigs that execute compoets Compoets physically package logical elemets Ð Nodes represet the physical deploymet of compoets Nodes (as well as compoets) ca participate i depedecy, geeralizatio, ad associatio relatioships They ca be ested, have istaces, participate i iteractios, etc. Nodes ca also have attributes ad operatios Commo uses for Deploymet Diagrams To model embedded systems Ð Nodes ca represet physical devices ad show how compoets access those devices To model cliet/server systems Ð See previous example To model fully distributed systems Ð Icludig adaptive systems for example, agets that migrate from ode to ode Collaboratios A collaboratio is a society of classes, iterfaces, ad other elemets that work together to provide a cooperative behavior Ð A collaboratio cosists of a structural part ad a behavioral part Class diagrams specify the former Iteractio diagrams specify the latter Ð Redered as a ellipse with dashed lies
Uses for collaboratios Modelig a mechaism Ð Show me all the classes ad activities ivolved with cliet-server commuicatio Modelig a use case Ð Show me all the classes ad iteractios to support the process order use case Modelig a operatio Ð Show me how ray tracig is accomplished Collaboratios, cotiued Elemets ca appear i multiple collaboratios Ð A collaboratio ca be thought of as a set of poiters ito a systemõs packages Ð Sort of like the perspective mechaismõs otio of a virtual copy Example Structural Aspect cliet server chimeraserver «actor» Commuicate with Other Servers * api * message * listeer hadler Cliet-Server Commuicatio request reply evet
Behavioral Aspect csapi:api «create» request :listeer csnativehadler:hadler SedRequest(r) SedReply(r) HadleRequest(r) SedReply(r) «create» reply