UNESCO-NIGERIA TECHNICAL & VOCATIONAL EDUCATION REVITALISATION PROJECT -PHASE II

NATIONAL DIPLOMA IN

COMPUTER TECHNOLOGY

(COM 213) YEAR2SEMESTER1 THEORY Version 1: December 2008

Pg 1

TABLEOFCONTENTS

Table of Contents WEEK 1 OJECTORIENTEDTECHNIQUE ...... 3 Overview ...... 3 Fundamentalconcepts ...... 4 History ...... 7 WEEK 2 UNIFIED MODELLING LANGUAGE (UML) – The General Overview ...... 12 History ...... 12 BeforeUML1.x ...... 13 UML1.x ...... 13 DevelopmenttowardUML2.0...... 14 UnifiedModelingLanguagetopics ...... 14 Methods ...... 14 Modelling ...... 15 Diagramsoverview ...... 15 WEEK 3-4 THESTRUCTUREDIAGRAM– ...... 21 WEEK 5 COMPOSITE DIAGRAM...... 42

WEEK 6 THECOMPONENTDIAGRAM ...... 48

WEEK 7 OBJECT AND PACKAGE DIAGRAM ...... 56 WEEK 8 DEPLOYMENT ...... 60

WEEK 9 THEBEHAVIOURDIAGRAM ...... 64

WEEK 10 THEUSECASEMODEL ...... 73 WEEK 11 THESTATEMACHINEMODEL ...... 79 WEEK 12 THEINTERACTIONDIAGRAM ...... 89 WEEK 13 THEINTERACTIONOVERVIEWDIAGRAM Aninteractionoverview diagramisaformofactivitydiagraminwhichthenodesrepresent interactiondiagrams...... 101 WEEK 14 THE UML TOOLS ...... 106 Features in UML Tools ...... 106 Popular UML Tools ...... 109 Integration of UML Tools with Integrated Development Environments (IDEs) ...... 111 WEEK 15 CASETOOLAPPLICATION ...... 112

Pg 2 WEEKOne

OJECT ORIENTED TECHNIQUE Introduction

Overview

Objectorientedprogrammingcantraceitsrootstothe1960s.As hardwareandsoftwarebecameincreasinglycomplex,qualitywas oftencompromised.Researchersstudiedwaysinwhichsoftware qualitycouldbemaintained.Objectorientedprogrammingwas deployedinpartasanattempttoaddressthisproblembystrongly emphasizingdiscreteunitsofprogramminglogicandreusabilityin software.Thecomputerprogrammingmethodologyfocusesondata ratherthanprocesses,withprogramscomposedofselfsufficient modules(objects)containingalltheinformationneededwithinits owndatastructureformanipulation.

The Simula programminglanguagewasthefirsttointroducethe conceptsunderlyingobjectorientedprogramming(objects,classes, subclasses,virtualmethods,coroutines,garbagecollection,and discreteeventsimulation)asasupersetof Algol .Simulawasused forphysicalmodeling,suchasmodelstostudyandimprovethe movementofshipsandtheircontentthroughcargoports. Smalltalk wasthefirstprogramminglanguagetobecalled"objectoriented".

Objectorientedprogrammingmaybeseenasacollectionof cooperating objects ,asopposedtoatraditionalviewinwhicha programmaybeseenasagroupoftaskstocompute (" subroutines ").InOOP,eachobjectiscapableofreceiving messages,processingdata,andsendingmessagestootherobjects.

Eachobjectcanbeviewedasanindependentlittlemachinewitha distinctroleorresponsibility.Theactionsor" operators "onthe objectsarecloselyassociatedwiththeobject.Forexample,in objectorientedprogramming,the datastructures tendtocarrytheir ownoperatorsaroundwiththem(oratleast"inherit"themfroma similarobjector"class").Thetraditionalapproachtendstoview andconsiderdataandbehaviorseparately.

Pg 3 Fundamental concepts

AsurveybyDeborahJ.Armstrongofnearly40yearsofcomputing literatureidentifiedanumberof‘quarks’,orfundamentalconcepts, foundinthestrongmajorityofdefinitionsofOOP.Theyarethe following:

Class Definestheabstractcharacteristicsofathing(object), includingthething'scharacteristics(its attributes , fields or properties )andthething'sbehaviors(the things it can do , or methods , operations or features ).Onemightsaythata classisa blueprint or factory thatdescribesthenatureof something.Forexample,theclass Dog wouldconsistoftraits sharedbyalldogs,suchasbreedandfurcolor (characteristics),andtheabilitytobarkandsit(behaviors). Classesprovidemodularityand structure inanobjectoriented computerprogram.Aclassshouldtypicallyberecognizableto anonprogrammerfamiliarwiththeproblemdomain, meaningthatthecharacteristicsoftheclassshouldmake senseincontext.Also,thecodeforaclassshouldbe relativelyselfcontained(generallyusing encapsulation ). Collectively,thepropertiesandmethodsdefinedbyaclass arecalled members . Object Apattern(exemplar)ofaclass.Theclassof Dog definesall possibledogsbylistingthecharacteristicsandbehaviorsthey canhave;theobject Lassie isoneparticulardog,with particularversionsofthecharacteristics.A Dog hasfur; Lassie hasbrownandwhitefur. Instance Onecanhaveaninstanceofaclassoraparticularobject.The instanceistheactualobjectcreatedatruntime.In programmerjargon,the Lassie objectisan instance ofthe Dog class.Thesetofvaluesoftheattributesofaparticular objectiscalledits state .Theobjectconsistsofstateandthe behaviourthat'sdefinedintheobject'sclass. Method Anobject'sabilities.Inlanguage,methodsareverbs. Lassie , beinga Dog ,hastheabilitytobark.So bark() isoneof Lassie 's methods.Shemayhaveothermethodsaswell,forexample sit() or eat() or walk() or save_timmy() .Withintheprogram,using amethodusuallyaffectsonlyoneparticularobject;all Dog s canbark,butyouneedonlyoneparticulardogtodothe barking. Messagepassing

Pg 4 “Theprocessbywhichanobjectsendsdatatoanotherobject oraskstheotherobjecttoinvokeamethod.” [1] Alsoknown tosomeprogramminglanguagesasinterfacing.E.g.the objectcalled Breeder maytellthe Lassie objecttositbypassing a'sit'messagewhichinvokesLassie's'sit'method.Thesyntax variesbetweenlanguages,forexample: [Lassiesit] in Objective.InJavacodelevelmessagepassingcorresponds to"methodcalling".Somedynamiclanguagesusedouble dispatchormultidispatchtofindandpassmessages. Inheritance ‘Subclasses’aremorespecializedversionsofaclass,which inherit attributesandbehaviorsfromtheirparentclasses,and canintroducetheirown. Forexample,theclass Dog mighthavesubclassescalled Collie , Chihuahua ,and GoldenRetriever .Inthiscase, Lassie would beaninstanceofthe Collie subclass.Supposethe Dog class definesamethodcalled bark() andapropertycalled furColor . Eachofitssubclasses( Collie , Chihuahua ,and GoldenRetriever ) willinheritthesemembers,meaningthattheprogrammer onlyneedstowritethecodeforthemonce. Eachsubclasscanalteritsinheritedtraits.Forexample,the Collie classmightspecifythatthedefault furColor foracollieis brownandwhite.The Chihuahua subclassmightspecifythat the bark() methodproducesahighpitchbydefault.Subclasses canalsoaddnewmembers.The Chihuahua subclasscouldadd amethodcalled tremble() .Soanindividualchihuahuainstance woulduseahighpitched bark() fromthe Chihuahua subclass, whichinturninheritedtheusual bark() from Dog .The chihuahuaobjectwouldalsohavethe tremble() method,but Lassie wouldnot,becausesheisa Collie ,nota Chihuahua .In fact,inheritanceisan‘isa’relationship: Lassie is a Collie .A Collie is a Dog .Thus, Lassie inheritsthemethodsofboth Collie s and Dog s. Multipleinheritance isinheritancefrommorethanone ancestorclass,neitheroftheseancestorsbeinganancestorof theother.Forexample,independentclassescoulddefine Dog s and Cat s,anda Chimera objectcouldbecreatedfromthese twowhichinheritsallthe(multiple)behaviorofcatsand dogs.Thisisnotalwayssupported,asitcanbehardbothto implementandtousewell. Abstraction Abstractionissimplifyingcomplexrealitybymodellingclasses appropriatetotheproblem,andworkingatthemost appropriatelevelofinheritanceforagivenaspectofthe problem. Forexample, Lassie the Dog maybetreatedasa Dog muchof thetime,a Collie whennecessarytoaccess Collie specific

Pg 5 attributesorbehaviors,andasan Animal (perhapstheparent classofDog )whencountingTimmy'spets. Abstractionisalsoachievedthrough Composition .For example,aclass Car wouldbemadeupofanEngine, Gearbox,Steeringobjects,andmanymorecomponents.To buildthe Car class,onedoesnotneedtoknowhowthe differentcomponentsworkinternally,butonlyhowto interface withthem,i.e.,sendmessagestothem,receive messagesfromthem,andperhapsmakethedifferentobjects composingtheclassinteractwitheachother. Encapsulation Encapsulationconcealsthefunctionaldetailsofaclassfrom objectsthatsendmessagestoit. Forexample,the Dog classhasa bark() method.Thecodefor the bark() methoddefinesexactlyhowabarkhappens(e.g., by inhale() andthen exhale() ,ataparticularpitchandvolume). Timmy, Lassie 'sfriend,however,doesnotneedtoknow exactlyhowshebarks.Encapsulationisachievedby specifyingwhichclassesmayusethemembersofanobject. Theresultisthateachobjectexposestoanyclassacertain interface —thosemembersaccessibletothatclass.The reasonforencapsulationistopreventclientsofaninterface fromdependingonthosepartsoftheimplementationthatare likelytochangeinfuture,therebyallowingthosechangesto bemademoreeasily,thatis,withoutchangestoclients.For example,aninterfacecanensurethatpuppiescanonlybe addedtoanobjectoftheclass Dog bycodeinthatclass. Membersareoftenspecifiedas public , protected or private ,determiningwhethertheyareavailabletoall classes,subclassesoronlythedefiningclass.Some languagesgofurther: Java usesthe default accessmodifier torestrictaccessalsotoclassesinthesamepackage, C# and VB.NET reservesomememberstoclassesinthesame assemblyusingkeywords internal (C#)or Friend (VB.NET), and Eiffel and C++ allowonetospecifywhichclassesmay accessanymember. Polymorphism Polymorphismallowstheprogrammertotreatderivedclass membersjustliketheirparentclass'members.More precisely, Polymorphisminobjectorientedprogramming is theabilityof objects belongingtodifferent datatypes to respondtomethodcallsof methods ofthesamename,each oneaccordingtoanappropriatetypespecificbehavior.One method,oranoperatorsuchas+,,or*,canbeabstractly appliedinmanydifferentsituations.Ifa Dog iscommandedto speak() ,thismayelicita bark() .However,ifa Pig iscommanded to speak() ,thismayelicitan oink() .Theybothinherit speak()

Pg 6 from Animal ,buttheirderivedclassmethodsoverridethe methodsoftheparentclass;thisisOverridingPolymorphism. OverloadingPolymorphismistheuseofonemethod signature,oroneoperatorsuchas‘+’,toperformseveral differentfunctionsdependingontheimplementation.The‘+’ operator,forexample,maybeusedtoperforminteger addition,floataddition,listconcatenation,orstring concatenation.Anytwosubclassesof Number ,suchas Integer and Double ,areexpectedtoaddtogetherproperlyinanOOP language.Thelanguagemustthereforeoverloadtheaddition operator,‘+’,toworkthisway.Thishelpsimprovecode readability.Howthisisimplementedvariesfromlanguageto language,butmostOOPlanguagessupportatleastsome levelofoverloadingpolymorphism.ManyOOPlanguagesalso supportParametricPolymorphism,wherecodeiswritten withoutmentionofanyspecifictypeandthuscanbeused transparentlywithanynumberofnewtypes. Pointers arean exampleofasimplepolymorphicroutinethatcanbeused withmanydifferenttypesofobjects. [2] Decoupling Decouplingallowsfortheseparationofobjectinteractions fromclassesandinheritanceintodistinctlayersof abstraction.Acommonuseofdecouplingistopolymorphically decoupletheencapsulation,whichisthepracticeofusing reusablecodetopreventdiscretecodemodulesfrom interactingwitheachother.

Notalloftheaboveconceptsaretobefoundinallobjectoriented programminglanguages,andsoobjectorientedprogrammingthat usesclassesiscalledsometimes classbasedprogramming .In particular, prototypebasedprogramming doesnottypicallyuse classes .Asaresult,asignificantlydifferentyetanalogous terminologyisusedtodefinetheconceptsof object and instance .

History

Theconceptofobjectsandinstancesincomputinghaditsfirst majorbreakthroughwiththe PDP1systemat MIT whichwas probablytheearliestexampleofcapabilitybasedarchitecture. Anotherearly example was Sketchpad madeby IvanSutherland in 1963;however,thiswasanapplicationandnota programming paradigm .Objectsasprogrammingentitieswereintroducedinthe 1960sin Simula67 ,aprogramminglanguagedesignedformaking simulations,createdby OleJohanDahl and KristenNygaard ofthe NorwegianComputingCenter in Oslo .(Reportedly,thestoryisthat theywereworkingonshipsimulations,andwereconfoundedbythe

Pg 7 combinatorialexplosionofhowthedifferentattributesfrom differentshipscouldaffectoneanother.Theideaoccurredtogroup thedifferenttypesofshipsintodifferentclassesofobjects,each classofobjectsbeingresponsiblefordefiningits own data and behavior .) [citation needed ]Suchanapproachwasasimpleextrapolation ofconceptsearlierusedin analog programming.On analog computers,mappingfromrealworldphenomena/objectstoanalog phenomena/objects(andconversely),was(andis)called 'simulation'.Simulanotonlyintroducedthenotionofclasses,but alsoofinstancesofclasses,whichisprobablythefirstexplicituse ofthosenotions.Theideasof Simula67 influencedmanylater languages,especiallySmalltalkandderivativesofLisp and Pascal .

The Smalltalk language,whichwasdevelopedat XeroxPARC inthe 1970s,introducedtheterm Object-oriented programming to representthepervasiveuseofobjectsandmessagesasthebasis forcomputation. Smalltalk creatorswereinfluencedbytheideas introducedin Simula67 ,but Smalltalk wasdesignedtobeafully dynamicsysteminwhichclassescouldbecreatedandmodified dynamicallyratherthanstaticallyasin Simula67 [3] .Smalltalkand withitOOPwereintroducedtoawideraudiencebytheAugust 1981issueof Bytemagazine .

Inthe1970s,Kay'sSmalltalkworkhadinfluencedthe Lisp community toincorporate objectbasedtechniques whichwere introducedtodevelopersviathe Lispmachine .Inthe1980s,there wereafewattemptstodesignprocessorarchitectureswhich includedhardwaresupportforobjectsinmemorybutthesewere notsuccessful.Examplesincludethe InteliAPX432 andthe Linn Smart Rekursiv .

Objectorientedprogrammingdevelopedasthedominant programmingmethodologyduringthemid1990s,largelyduetothe influenceof C++ [citation needed ].Itsdominancewasfurtherenhanced bytherisingpopularityof graphicaluserinterfaces ,forwhich objectorientedprogrammingseemstobewellsuited.Anexample ofacloselyrelateddynamicGUIlibraryandOOPlanguagecanbe foundinthe Cocoa frameworkson MacOSX ,writtenin ObjectiveC , anobjectoriented,dynamicmessagingextensiontoCbasedon Smalltalk.OOPtoolkitsalsoenhancedthepopularityof eventdriven programming (althoughthisconceptisnotlimitedtoOOP).Some feelthatassociationwithGUIs(realorperceived)waswhat propelledOOPintotheprogrammingmainstream.

At ETHZürich , NiklausWirth andhiscolleagueshadalsobeen investigatingsuchtopicsas dataabstraction and modular programming . Modula2includedboth,andtheirsucceedingdesign, Oberon ,includedadistinctiveapproachtoobjectorientation,

Pg 8 classes,andsuch.TheapproachisunlikeSmalltalk,andveryunlike C++.

Objectorientedfeatureshavebeenaddedtomanyexisting languagesduringthattime,including Ada , BASIC , Fortran , Pascal , andothers.Addingthesefeaturestolanguagesthatwerenot initiallydesignedforthemoftenledtoproblemswithcompatibility andmaintainabilityofcode.

Inthepastdecade Java hasemergedinwideusepartiallybecause ofitssimilarityto Candto C++ ,butperhapsmoreimportantly becauseofitsimplementationusinga virtualmachine thatis intendedtoruncodeunchangedonmanydifferentplatforms.This lastfeaturehasmadeitveryattractivetolargerdevelopmentshops withheterogeneousenvironments.Microsoft's .NET initiativehasa similarobjectiveandincludes/supportsseveralnewlanguages,or variantsofolderoneswiththeimportantcaveatthatitis,ofcourse, restrictedtothe Microsoft platform.

Morerecently,anumberoflanguageshaveemergedthatare primarilyobjectorientedyetcompatiblewithprocedural methodology,suchas Python and Ruby .BesidesJava,probablythe mostcommerciallyimportantrecentobjectorientedlanguagesare VisualBasic.NET (VB.NET)and C# ,bothdesignedforMicrosoft's .NET platform.VB.NETandC#bothsupportcrosslanguage inheritance,allowingclassesdefinedinonelanguagetosubclass classesdefinedintheotherlanguage.

RecentlymanyuniversitieshavebeguntoteachObjectoriented designinintroductorycomputerscienceclasses.

Justas proceduralprogramming ledtorefinementsoftechniques suchas structuredprogramming ,modernobjectorientedsoftware designmethodsincluderefinementssuchastheuseof design patterns , designbycontract ,and modelinglanguages (suchas UML ).

PROCEDURAL, STRUCTURED, AND OBJECT-ORIENTED PROGRAMMING

Untilrecently,programswerethoughtofasaseriesofprocedures thatactedupondata.A Procedure ,orfunction,isasetofspecific instructions executed one after the other. The data was quite separatefromtheprocedures,andthetrickinprogrammingwasto

Pg 9 keeptrackofwhichfunctionscalledwhichotherfunctions,andwhat data was changed. To make sense of this potentially confusing situation,structuredprogrammingwascreated. The principle idea behind Structured Programming is as simple as the idea of divide and conquers. A computer program can be thought of as consisting of a set of tasks. Any task that is too complextobedescribedsimplywouldbebrokendownintoasetof smallercomponenttasks,untilthetasksweresufficientlysmalland selfcontainedenoughthattheywereeasilyunderstood. Structured programming remains an enormously successful approach for dealing with complex problems. By the late 1980s, however, some of the deficiencies of structured programming had becamealltooclear. First,itisnaturaltothinkofyourdata(employeerecords,for example)andwhatyoucandowithyourdata(sort,edit,and soon)asrelatedideas. Second, programmers found themselves constantly reinventingnewsolutionstooldproblems.Thisisoftencalled "reinventingthewheel,"andistheoppositeofreusability. Theideabehindreusabilityistobuildcomponentsthathaveknown properties,andthentobeabletoplugthemintoyourprogramas youneedthem.Thisismodelledafterthehardwareworldwhenan engineerneedsanewtransistor,hedoesn'tusuallyinventone,he goestothebigbinoftransistorsandfindsonethatworkstheway heneedsitto,orperhapsmodifiesit.Therewasnosimilaroption forasoftwareengineer.Thewaywearenowusingcomputerswith menusandbuttonsandwindowsfostersamoreinteractive,event driven approach to computer programming. Event-driven means thataneventhappenstheuserpressesabuttonorchoosesfroma menuand the program must respond. Programs are becoming increasinglyinteractive,andithasbecomeimportanttodesignfor thatkindoffunctionality.Oldfashionedprogramsforcedtheuserto proceed stepbystep through a series of screens. Modern event drivenprogramspresentallthechoicesatonceandrespondtothe user'sactions. Object-Oriented Programming (OOP) attempts to respond to these needs, providing techniques for managing enormous complexity, achieving reuseof software components, and coupling datawiththetasksthatmanipulatethatdata. The essence of objectoriented programming is to treat data and theproceduresthatactuponthedataasasingle"object"aself contained entity with an identity and certain characteristics of its own.

Pg 10 The Pillars of OOP Development When working with computers, it is very important to be fashionable! In the 1960s, the new fashion was what were called high-level languages such as FORTRAN and COBOL, in which the programmer did not have to understand the machine instructions. In the 1970s, people realized that there were better ways to program than with a jumble of GOTO statements, and the structured programming languages such as COBOL were invented. Inthe1980s,muchtimewasinvestedintryingtogetgoodresults out of fourth-generation languages (4Gls), in which complicated programmingstructurescouldbecodedinafewwords(ifyoucould find the right words with so many words to choose from). There were also schemes such as Analyst Workbenches, which made systems analysts into highly paid and overqualified programmers. The fashion of the 1990s is most definitely objectoriented programming. Importance of OOP Definition: Object-oriented programming isaproductivitytool. Each of these features is a step on the road to reliable and productive programming. By using prebuilt libraries of code, you cansavetimeandstillhavetheflexibilityofalteringthewaythat theyworktosuityourownneeds.WithOOPtherearelotsofextra features that encourage putting thought into structuring programs so that they are more maintainable. By gathering code into CLASSES, large programs are divided into small manageable sections, in the same way that you divide small programs into functions. This is very important, because the difficulty of understandingpiecesofcodeincreasesexponentially.

Pg 11

WEEK Two

UNIFIED MODELLING LANGUAGE (UML) – The General Overview

Introduction

TheUnifiedModellingLanguage(UML)isagraphicallanguagefor visualizing,specifyingandconstructingtheartifactsofasoftware intensivesystem.TheUnifiedModellingLanguageoffersastandard waytowriteasystem'sblueprints,includingconceptualthingssuch asbusinessprocessesandsystemfunctionsaswellasconcrete thingssuchasprogramminglanguagestatements,database schemas,andreusablesoftwarecomponents.Oneofthepurposes ofUMLwastoprovidethedevelopmentcommunitywithastable andcommondesignlanguagethatcouldbeusedtodevelopand buildcomputerapplications.UMLbroughtforthaunifiedstandard modellingnotationthatITprofessionalshadbeenwantingforyears. UsingUML,ITprofessionalscouldnowreadanddisseminatesystem structureanddesignplansjustasconstructionworkershave beendoingforyearswithblueprintsofbuildings. ItisnowthetwentyfirstcenturyandUMLhasgainedtractionin ourprofession. UMLcombinesthebestpracticefromdatamodellingconceptssuch asentityrelationshipdiagrams,businessmodelling(workflow), objectmodellingandcomponentmodelling.Itcanbeusedwithall processes,throughoutthesoftwaredevelopmentlifecycle,and acrossdifferentimplementationtechnologies. Standardization UMLisofficiallydefinedbytheObjectManagementGroup(OMG)as theUMLmetamodel,aMetaObjectFacilitymetamodel(MOF).Like otherMOFbasedspecifications,UMLhasallowedsoftware developerstoconcentratemoreondesignandarchitecture. UMLmodelsmaybeautomaticallytransformedtoother representations(e.g.Java)bymeansofQVTliketransformation languages,supportedbytheOMG. History HistoryofObjectOrientedmethodsandnotation.

Pg 12 Before UML 1.x AfterRationalSoftwareCorporationhiredJamesRumbaughfrom GeneralElectricin1994,thecompanybecamethesourceforthe twomostpopularobjectorientedmodelingapproachesoftheday: Rumbaugh'sOMT,whichwasbetterforobjectorientedanalysis (OOA),andGradyBooch'sBoochmethod,whichwasbetterfor objectorienteddesign(OOD).TogetherRumbaughandBooch attemptedtoreconciletheirtwoapproachesandstartedworkona UnifiedMethod. TheyweresoonassistedintheireffortsbyIvarJacobson,the creatoroftheobjectorientedsoftwareengineering(OOSE)method. JacobsonjoinedRationalin1995,afterhiscompany,Objectory,was acquiredbyRational.Thethreemethodologistswerecollectively referredtoasthe Three Amigos ,sincetheywerewellknownto arguefrequentlywitheachotherregardingmethodological preferences. In1996Rationalconcludedthattheabundanceofmodeling languageswasslowingtheadoptionofobjecttechnology,so repositioningtheworkonaUnifiedMethod,theytaskedtheThree AmigoswiththedevelopmentofanonproprietaryUnifiedModeling Language.RepresentativesofcompetingObjectTechnology companieswereconsultedduringOOPSLA'96,andchose boxes for representingclassesoverGradyBooch'sBoochmethod'snotation thatused cloud symbols. UnderthetechnicalleadershipoftheThreeAmigos,aninternational consortiumcalledtheUMLPartnerswasorganizedin1996to completethe Unified Modeling Language (UML) specification,and proposeitasaresponsetotheOMGRFP.TheUMLPartners'UML 1.0specificationdraftwasproposedtotheOMGinJanuary1997. DuringthesamemonththeUMLPartnersformedaSemanticsTask Force,chairedbyCrisKobrynandadministeredbyEdEykholt,to finalizethesemanticsofthespecificationandintegrateitwithother standardizationefforts.Theresultofthiswork,UML1.1,was submittedtotheOMGinAugust1997andadoptedbytheOMGin November1997 [3] .

UML 1.x Asamodelingnotation,theinfluenceoftheOMTnotation dominates(e.g.,usingrectanglesforclassesandobjects).Though theBooch"cloud"notationwasdropped,theBoochcapabilityto specifylowerleveldesigndetailwasembraced.Theusecase notationfromObjectoryandthecomponentnotationfromBooch wereintegratedwiththerestofthenotation,butthesemantic integrationwasrelativelyweakinUML1.1,andwasnotreallyfixed untiltheUML2.0majorrevision.

Pg 13 ConceptsfrommanyotherOOmethodswerealsolooselyintegrated withUMLwiththeintentthatUMLwouldsupportallOOmethods. ForexampleCRCCards(circa1989fromKentBeckandWard Cunningham),andOORamwereretained.Manyotherscontributed toowiththeirapproachesflavoringthemanymodelsoftheday including:TonyWassermanandPeterPircherwiththe"Object OrientedStructuredDesign(OOSD)"notation(notamethod),Ray Buhr's"SystemsDesignwithAda",ArchieBowen'susecaseand timinganalysis,PaulWard'sdataanalysisandDavidHarel's "Statecharts",asthegrouptriedtoensurebroadcoverageinthe realtimesystemsdomain.Asaresult,UMLisusefulinavarietyof engineeringproblems,fromsingleprocess,singleuserapplications toconcurrent,distributedsystems,makingUMLrichbutlarge. TheUnifiedModelingLanguageisaninternationalstandard: Development toward UML 2.0 UMLhasmaturedsignificantlysinceUML1.1.Severalminor revisions(UML1.3,1.4,and1.5)fixedshortcomingsandbugswith thefirstversionofUML,followedbytheUML2.0majorrevisionthat wasadoptedbytheOMGin2005.TherearefourpartstotheUML 2.xspecification:theSuperstructurethatdefinesthenotationand semanticsfordiagramsandtheirmodelelements;the Infrastructurethatdefinesthecoremetamodelonwhichthe Superstructureisbased;theObjectConstraintLanguage(OCL)for definingrulesformodelelements;andtheUMLDiagram InterchangethatdefineshowUML2diagramlayoutsare exchanged.Thecurrentversionsofthesestandardsfollow:UML Superstructureversion2.1.2,UMLInfrastructureversion2.1.2,OCL version2.0,andUMLDiagramInterchangeversion1.0. AlthoughmanyUMLtoolssupportsomeofthenewfeaturesofUML 2.x,theOMGprovidesnotestsuitetoobjectivelytestcompliance withitsspecifications.

Unified Modeling Language topics Methods UMLisnotamethodbyitself;however,itwasdesignedtobe compatiblewiththeleadingobjectorientedsoftwaredevelopment methodsofitstime(forexampleOMT,Boochmethod,Objectory). SinceUMLhasevolved,someofthesemethodshavebeenrecastto takeadvantageofthenewnotations(forexampleOMT),andnew methodshavebeencreatedbasedonUML.ThebestknownisIBM RationalUnifiedProcess(RUP).TherearemanyotherUMLbased methodslikeAbstractionMethod,DynamicSystemsDevelopment

Pg 14 Method,andothers,designedtoprovidemorespecificsolutions,or achievedifferentobjectives.

Modelling ItisveryimportanttodistinguishbetweentheUMLmodelandthe setofdiagramsofasystem.Adiagramisapartialgraphical representationofasystem'smodel.Themodelalsocontainsa "semanticbackplane"—documentationsuchaswrittenusecases thatdrivethemodelelementsanddiagrams. UMLdiagramsrepresentthreedifferentviewsofasystemmodel: • Functionalrequirementsview:Emphasizesthefunctional requirementsofthesystemfromtheuser'spointofview.And includesusecasediagrams. • Staticstructuralview:Emphasizesthestaticstructureofthe systemusingobjects,attributes,operationsandrelationships. Andincludesclassdiagramsandcompositestructure diagrams. • Dynamicbehaviorview:Emphasizesthedynamicbehaviorof thesystembyshowingcollaborationsamongobjectsand changestotheinternalstatesofobjects.Andincludes sequencediagrams,activitydiagramsandstatemachine diagrams. UMLmodelscanbeexchangedamongUMLtoolsbyusingtheXMI interchangeformat.

Diagrams overview UML2.0has13typesofdiagramsdividedintothreecategories:Six diagramtypesrepresent structure applicationstructure,three representgeneraltypesof behavior ,andfourrepresentdifferent aspectsof interactions .Thesediagramscanbecategorized hierarchicallyasshowninthefollowingClassdiagram:

Pg 15 UMLdoesnotrestrictUMLelementtypestoacertaindiagramtype. Ingeneral,everyUMLelementmayappearonalmostalltypesof diagrams.ThisflexibilityhasbeenpartiallyrestrictedinUML2.0. Inkeepingwiththetraditionofengineeringdrawings,acommentor noteexplainingusage,constraint,orintentisalwaysallowedina UMLdiagram.

Structure diagrams Structurediagramsemphasizewhatthingsmustbeinthesystem beingmodeled: • Classdiagram:describesthestructureofasystemby showingthesystem'sclasses,theirattributes,andthe relationshipsamongtheclasses. • Componentdiagram:depictshowasoftwaresystemissplit upintocomponentsandshowsthedependenciesamong thesecomponents. • Compositestructurediagram:describestheinternalstructure ofaclassandthecollaborationsthatthisstructuremakes possible. • Deploymentdiagramservestomodelthehardwareusedin systemimplementations,thecomponentsdeployedonthe hardware,andtheassociationsamongthosecomponents. • Objectdiagram:showsacompleteorpartialviewofthe structureofamodeledsystemataspecifictime. • Packagediagram:depictshowasystemissplitupintological groupingsbyshowingthedependenciesamongthese groupings.

Composite Component Classdiagram structurediagrams Deployment diagram diagram

Object diagram Package diagram

Pg 16

Behavior diagrams Behaviordiagramsemphasizewhatmusthappeninthesystem beingmodeled: • Activitydiagram:representsthebusinessandoperational stepbystepworkflowsofcomponentsinasystem.An activitydiagramshowstheoverallflowofcontrol. • Statediagram:standardizednotationtodescribemany systems,fromcomputerprogramstobusinessprocesses. • Usecasediagram:showsthefunctionalityprovidedbya systemintermsofactors,theirgoalsrepresentedasuse cases,andanydependenciesamongthoseusecases.

Usecasediagram UMLActivityDiagram StateMachinediagram

Interaction diagrams Interactiondiagrams,asubsetofbehaviordiagrams,emphasizethe flowofcontrolanddataamongthethingsinthesystembeing modelled: • Communicationdiagramshowstheinteractionsbetween objectsorpartsintermsofsequencedmessages.They representacombinationofinformationtakenfromClass, Sequence,andUseCaseDiagramsdescribingboththestatic structureanddynamicbehaviorofasystem. • Interactionoverviewdiagram:atypeofactivitydiagramin whichthenodesrepresentinteractiondiagrams. • Sequencediagram:showshowobjectscommunicatewith eachotherintermsofasequenceofmessages.Alsoindicates thelifespansofobjectsrelativetothosemessages. • Timingdiagrams:areaspecifictypeofinteractiondiagram, wherethefocusisontimingconstraints.

Communication diagram Interactionoverview Sequence diagram diagram TheProtocolStateMachineisasubvariantoftheStateMachine.It maybeusedtomodelnetworkcommunicationprotocols.

Pg 17

The Relevance of UML to Software Peopleallovertheworldusecommonnotationsusuallypictorialto depictevents,actions,operationsoractivities.Exampleisinthe fieldsofmathematicswheresignssuchas+,=,etcarecommon andgenerallyacceptedarithmeticnotations.Withlittleorno explanationeveryonecaneasilyunderstandwhattheymean. Anothermathematicexampleisdiagramsuchastheonebelow; Nowthistriangleisunambiguouslya right angle triangle ,because thelittlesquareattachedisaworldwideconventionmeaning"right angle."Furthermore,thesidesofthetrianglecanbelabelledA,B, andC:

And,immediately,wecanwritedownthat A2 + B 2 = C 2 Nowthishasafewveryendearingproperties.First,itisonceagain anexampleofauniversalnotation.Rightangles,righttriangles, andthesymbolsrepresentingthemarethesameallovertheworld; someonefromancientEgyptcouldinprinciplereasonaboutright triangleswithamodernPeruvianbydrawingsuchdiagrams.What's more,oncethediagramfortherighttrianglehasbeenwritten down,therelationshipofA,B,andCisdefined.A,B,andCcanno longerhavecompletelyarbitraryvalues;onceanytwoofthemare specified,thethirdisdeterminedaswell.Thediagramimpliesthe PythagoreanTheorem.Onecouldevengosofarastosaythatthe diagramhassome"semantics,"thatthereisawellunderstood relationshipbetweenthepictureandthevaluesimpliedbythe letters.

Pg 18 Whatistrulyamazingaboutthisexampleisthatanyonewithahigh schooleducationcanunderstandit.Ifthepersonhasseenany geometryatall,theyhaveseentrianglesandrighttriangles,andif theyrememberanythingatallfromtheirgeometry,itisgoodold Pythagoras. Wecansaythatnotonlyinmathematicsbutinallotherfields progressismadebyhavingacommonnotationthatcanbeusedto expressconcepts,andhowdiagramsbegintotakeonprecisionand meaningonceweattachsemanticstothepictures.Themostuseful ofthesenotationsareunderstoodtheworldover. Butbefore1996therewasnocommonnotationforsoftware.Before theUMLbecameaninternationalstandard,twosoftwareengineers, even if they spoke the same language ,hadnowaytotalkabout theirsoftware.Therewerenoconventionsthatwereuniversally acceptedaroundtheworldfordescribingsoftware.Nowonder progresswasslow! WiththeadventoftheUML,however,softwareengineershavea commongraphicvocabularyfortalkingaboutsoftware.Theycan drawprogressivelycomplexdiagramstorepresenttheirsoftware, justthewayelectricalengineerscandrawprogressivelycomplex diagramstorepresenttheircircuits.

An electrical circuit

Thingslikenesteddiagramsbecomepossible,sodifferentlevelsof abstractioncannowbeexpressed. Rational'scontributioninthisareaishuge.ByformulatingtheUML andbringingtheworld'smostinfluentialcompaniesIBM, Microsoft,HP,Oracle,etc.toagreeonitwasamajorstep. GettinganinternationalstandardsbodytheObjectManagement Group–(OMG)toratifyitasastandardwastheformalprocess

Pg 19 thatirreversiblycastthedie.EveryoneagreedtoendtheTowerof Babelapproachandalsoagreedabouthowtotalkaboutsoftware. ThesignificanceoftheUMLisnowestablished,andwecanmove on.

Pg 20

WEEKThree

THE STRUCTURE DIAGRAM – Introduction Thestructurediagramsshowthestaticstructureofthesystem beingmodelled;focusingontheelementsofasystem,irrespective oftime.Staticstructureisconveyedbyshowingthetypesandtheir instancesinthesystem.Besidesshowingsystemtypesandtheir instances,structurediagramsalsoshowatleastsomeofthe relationshipsamongandbetweentheseelementsandpotentially evenshowtheirinternalstructure. Structurediagramsareusefulthroughoutthesoftwarelifecyclefor avarietyofteammembers.Ingeneral,thesediagramsallowfor designvalidationanddesigncommunicationbetweenindividuals andteams.Forexample,businessanalystscanuseclassorobject diagramstomodelabusiness'scurrentassetsandresources,such asaccountledgers,products,orgeographichierarchy.Architects canusethecomponentanddeploymentdiagramstotest/verifythat theirdesignissound.Developerscanuseclassdiagramstodesign anddocumentthesystem'scoded(orsoontobecoded)classes. TheStructurediagramsanditsvariouscomponentsarehighlighted asbelow.

The class diagram

Pg 21 TheClassdiagramdescribesthestructureofasystembyshowing thesystem'sclasses,theirattributes,andtherelationshipsamong theclasses. UML2considersstructurediagramsasaclassification;thereisno diagramitselfcalleda"StructureDiagram."However,theclass diagramoffersaprimeexampleofthestructurediagramtype,and providesuswithaninitialsetofnotationelementsthatallother structurediagramsuse.Andbecausetheclassdiagramisso foundational,theremainderofthisarticlewillfocusontheclass diagram'snotationset.Bytheendofthisarticleyoushouldhavean understandingofhowtodrawaUML2classdiagramandhavea solidfootingforunderstandingotherstructurediagramswhenwe covertheminlaterarticles. The basics of Class Diagram ItismoreimportantthaneverinUML2tounderstandthebasicsof theclassdiagram.Thisisbecausetheclassdiagramprovidesthe basicbuildingblocksforallotherstructurediagrams,suchasthe componentorobjectdiagrams. Asmentionedearlier,thepurposeoftheclassdiagramistoshow thetypesbeingmodelledwithinthesystem.InmostUMLmodels thesetypesinclude:

• aclass

• aninterface

• adatatype

• acomponent.

UMLusesaspecialnameforthesetypes:"classifiers."Generally, youcanthinkofaclassifierasaclass,buttechnicallyaclassifieris amoregeneraltermthatreferstotheotherthreetypesaboveas well. Class name TheUMLrepresentationofaclassisarectanglecontainingthree compartmentsstackedvertically,asshowninFigure3.1.Thetop compartmentshowstheclass'sname.Themiddlecompartmentlists theclass'sattributes.Thebottomcompartmentliststheclass's operations.Whendrawingaclasselementonaclassdiagram,you mustusethetopcompartment,andthebottomtwocompartments

Pg 22 areoptional.(Thebottomtwowouldbeunnecessaryonadiagram depictingahigherlevelofdetailinwhichthepurposeistoshow onlytherelationshipbetweentheclassifiers.)Figure3.1showsan airlineflightmodelledasaUMLclass.Aswecansee,thenameis Flight ,andinthemiddlecompartmentweseethattheFlightclass hasthreeattributes:flightNumber,departureTime,and flightDuration.InthebottomcompartmentweseethattheFlight classhastwooperations:delayFlightandgetArrivalTime.

Figure 1: Class diagram for the class Flight

Class attribute list Theattributesectionofaclass(themiddlecompartment)listseach oftheclass'sattributesonaseparateline.Theattributesectionis optional,butwhenuseditcontainseachattributeoftheclass displayedinalistformat.Thelineusesthefollowingformat: name:attributetype flightNumber:Integer ContinuingwithourFlightclassexample,wecandescribethe class'sattributeswiththeattributetypeinformation,asshownin Table3.1.

Table 3.1: The Flight class's attribute names with their associated types AttributeName AttributeType flightNumber Integer departureTime Date flightDuration Minutes

Pg 23 Inbusinessclassdiagrams,theattributetypesusuallycorrespond tounitsthatmakesensetothelikelyreadersofthediagram(i.e., minutes,dollars,etc.).However,aclassdiagramthatwillbeused togeneratecodeneedsclasseswhoseattributetypesarelimitedto thetypesprovidedbytheprogramminglanguage,ortypesincluded inthemodelthatwillalsobeimplementedinthesystem. Sometimesitisusefultoshowonaclassdiagramthataparticular attributehasadefaultvalue.(Forexample,inabankingaccount applicationanewbankaccountwouldstartoffwithazerobalance.) TheUMLspecificationallowsfortheidentificationofdefaultvalues intheattributelistsectionbyusingthefollowingnotation: name:attributetype=defaultvalue Forexample: balance:Dollars=0 Showingadefaultvalueforattributesisoptional;Figure3.2shows aBankAccountclasswithanattributecalled balance ,whichhasa defaultvalueof0.

Figure 3.2: A Bank Account class diagram showing the balance attribute's value defaulted to zero dollars.

Class operations list Theclass'soperationsaredocumentedinthethird(lowest) compartmentoftheclassdiagram'srectangle,whichagainis optional.Liketheattributes,theoperationsofaclassaredisplayed inalistformat,witheachoperationonitsownline.Operationsare documentedusingthefollowingnotation: name(parameterlist):typeofvaluereturned TheFlightclass'soperationsaremappedinTable2below.

Pg 24

Table 3.2: Flight class's operations mapped from Figure 3.2 Operation Name Parameters Return Value Type delayFlight Name Type N/A numberOfMinutes Minutes

getArrivalTime N/A Date

Figure3.3showsthatthedelayFlightoperationhasoneinput parameternumberOfMinutesofthetypeMinutes.However,the delayFlightoperationdoesnothaveareturnvalue.Whenan operationhasparameters,theyareputinsidetheoperation's parentheses;eachparameterusestheformat"parametername: parametertype".

Figure 3.3: The Flight class operations parameters include the optional "in" marking. Whendocumentinganoperation'sparameters,youmayusean optionalindicatortoshowwhetherornottheparameterisinputto, oroutputfrom,theoperation.Thisoptionalindicatorappearsasan "in"or"out"asshownintheoperationscompartmentinFigure2. Typically,theseindicatorsareunnecessaryunlessanolder programminglanguagesuchasFortranwillbeused,inwhichcase thisinformationcanbehelpful.However,inC++andJava,all parametersare"in"parametersandsince"in"istheparameter's defaulttypeaccordingtotheUMLspecification,mostpeoplewill leaveouttheinput/outputindicators.

Inheritance

Pg 25 Averyimportantconceptinobjectorienteddesign, inheritance , referstotheabilityofoneclass(childclass)to inherit theidentical functionalityofanotherclass(superclass),andthenaddnew functionalityofitsown.(Inaverynontechnicalsense,imaginethat Iinheritedmymother'sgeneralmusicalabilities,butinmyfamily I'mtheonlyonewhoplayselectricguitar.)Tomodelinheritanceon aclassdiagram,asolidlineisdrawnfromthechildclass(theclass inheritingthebehavior)withaclosed,unfilledarrowhead(or triangle)pointingtothesuperclass.Considertypesofbank accounts:Figure3.4showshowbothCheckingAccountand SavingsAccountclassesinheritfromtheBankAccountclass.

Figure 3.4: Inheritance is indicated by a solid line with a closed, unfilled arrowhead pointing at the super class. InFigure3.4,theinheritancerelationshipisdrawnwithseparate linesforeachsubclass,whichisthemethodusedinIBMRational RoseandIBMRationalXDE.However,thereisanalternativewayto drawinheritancecalled tree notation .Youcanusetreenotation whentherearetwoormorechildclasses,asinFigure3.4,except thattheinheritancelinesmergetogetherlikeatreebranch.Figure 3.5isaredrawingofthesameinheritanceshowninFigure3.4,but thistimeusingtreenotation.

Pg 26 Figure 3.5: An example of inheritance using tree notation

Abstract classes and operations TheobservantreaderwillnoticethatthediagramsinFigures3.4 and3.5useitalicizedtextfortheBankAccountclassnameand withdrawaloperation.ThisindicatesthattheBankAccountclassis anabstractclassandthewithdrawalmethodisanabstract operation.Inotherwords,theBankAccountclassprovidesthe abstractoperationsignatureofwithdrawalandthetwochildclasses ofCheckingAccountandSavingsAccounteachimplementtheirown versionofthatoperation. However,superclasses(parentclasses)donothavetobeabstract classes.Itisnormalforastandardclasstobeasuperclass.

Associations Whenyoumodelasystem,certainobjectswillberelatedtoeach other,andtheserelationshipsthemselvesneedtobemodelledfor clarity.Therearefivetypesofassociations.bidirectional,uni directionalassociations,Associationclass,Aggregation,and Reflexiveassociations Bi-directional (standard) association Anassociationisalinkagebetweentwoclasses.Associationsare alwaysassumedtobebidirectional;thismeansthatbothclasses areawareofeachotherandtheirrelationship,unlessyouqualify theassociationassomeothertype.GoingbacktoourFlight example,Figure3.6showsastandardkindofassociationbetween theFlightclassandthePlaneclass.

Pg 27 Figure 3.6: An example of a bi-directional association between a Flight class and a Plane class Abidirectionalassociationisindicatedbyasolidlinebetweenthe twoclasses.Ateitherendoftheline,youplacearolenameanda multiplicityvalue.Figure3.6showsthattheFlightisassociatedwith aspecificPlane,andtheFlightclassknowsaboutthisassociation. ThePlanetakesontheroleof"assignedPlane"inthisassociation becausetherolenamenexttothePlaneclasssaysso.The multiplicityvaluenexttothePlaneclassof0..1meansthatwhen aninstanceofaFlightexists,itcaneitherhaveoneinstanceofa PlaneassociatedwithitornoPlanesassociatedwithit(i.e.,maybe aplanehasnotyetbeenassigned).Figure3.6alsoshowsthata PlaneknowsaboutitsassociationwiththeFlightclass.Inthis association,theFlighttakesontheroleof"assignedFlights";the diagraminFigure3.6tellsusthatthePlaneinstancecanbe associatedeitherwithnoflights(e.g.,it'sabrandnewplane)or withuptoaninfinitenumberofflights(e.g.,theplanehasbeenin commissionforthelastfiveyears). Forthosewonderingwhatthepotentialmultiplicityvaluesarefor theendsofassociations,Table3.3belowlistssomeexample multiplicityvaluesalongwiththeirmeanings. Table 3.3: Multiplicity values and their indicators PotentialMultiplicityValues Indicator Meaning 0..1 Zeroorone 1 Oneonly 0..* Zeroormore * Zeroormore 1..* Oneormore 3 Threeonly 0..5 ZerotoFive

Pg 28 5..15 FivetoFifteen

Uni-directional association Inaunidirectionalassociation,twoclassesarerelated,butonly oneclassknowsthattherelationshipexists.Figure3.7showsan exampleofanoverdrawnaccountsreportwithaunidirectional association.

Figure 3.7: An example of a uni-directional association: The OverdrawnAccountsReport class knows about the BankAccount class, but the BankAccount class does not know about the association. Aunidirectionalassociationisdrawnasasolidlinewithanopen arrowhead(nottheclosedarrowhead,ortriangle,usedtoindicate inheritance)pointingtotheknownclass.Likestandardassociations, theunidirectionalassociationincludesarolenameanda multiplicityvalue,butunlikethestandardbidirectionalassociation, theunidirectionalassociationonlycontainstherolenameand multiplicityvaluefortheknownclass.InourexampleinFigure3.7, theOverdrawnAccountsReportknowsabouttheBankAccountclass, andtheBankAccountclassplaystheroleof"overdrawnAccounts." However,unlikeastandardassociation,theBankAccountclasshas noideathatitisassociatedwiththeOverdrawnAccountsReport.

Association class Inmodelinganassociation,therearetimeswhenyouneedto includeanotherclassbecauseitincludesvaluableinformationabout therelationship.Forthisyouwouldusean association class that youtietotheprimaryassociation.Anassociationclassis representedlikeanormalclass.Thedifferenceisthatthe associationlinebetweentheprimaryclassesintersectsadottedline connectedtotheassociationclass.Figure3.8showsanassociation classforourairlineindustryexample.

Pg 29 Figure 3.8: Adding the association class MileageCredit IntheclassdiagramshowninFigure11,theassociationbetween theFlightclassandtheFrequentFlyerclassresultsinanassociation classcalledMileageCredit.Thismeansthatwhenaninstanceofa FlightclassisassociatedwithaninstanceofaFrequentFlyerclass, therewillalsobeaninstanceofaMileageCreditclass. Aggregation Aggregationisaspecialtypeofassociationusedtomodela"whole toitsparts"relationship.Inbasicaggregationrelationships,the lifecycleofa part classisindependentfromthe whole class's lifecycle. Forexample,wecanthinkof Car asawholeentityand Car Wheel aspartoftheoverallCar.Thewheelcanbecreatedweeksaheadof time,anditcansitinawarehousebeforebeingplacedonacar duringassembly.Inthisexample,theWheelclass'sinstanceclearly livesindependentlyoftheCarclass'sinstance.However,thereare timeswhenthe part class'slifecycle is not independentfromthatof the whole classthisiscalledcompositionaggregation.Consider, forexample,therelationshipofacompanytoitsdepartments.Both Company and Departments aremodelledasclasses,anda departmentcannotexistbeforeacompanyexists.Herethe Departmentclass'sinstanceisdependentupontheexistenceofthe Companyclass'sinstance. Let'sexplorebasicaggregationandcompositionaggregation further.

Basic aggregation Anassociationwithanaggregationrelationshipindicatesthatone classisapartofanotherclass.Inanaggregationrelationship,the childclassinstancecanoutliveitsparentclass.Torepresentan aggregationrelationship,youdrawasolidlinefromtheparentclass tothepartclass,anddrawanunfilleddiamondshapeontheparent class'sassociationend.Figure3.9showsanexampleofan aggregationrelationshipbetweenaCarandaWheel.

Pg 30 Figure 3.9: Example of an aggregation association

Composition aggregation Thecompositionaggregationrelationshipisjustanotherformofthe aggregationrelationship,butthechildclass'sinstancelifecycleis dependentontheparentclass'sinstancelifecycle.InFigure3.10, whichshowsacompositionrelationshipbetweenaCompanyclass andaDepartmentclass,noticethatthecompositionrelationshipis drawnliketheaggregationrelationship,butthistimethediamond shapeisfilled.

Figure 3.10: Example of a composition relationship IntherelationshipmodelledinFigure3.10,aCompanyclass instancewillalwayshaveatleastoneDepartmentclassinstance. Becausetherelationshipisacompositionrelationship,whenthe Companyinstanceisremoved/destroyed,theDepartmentinstance isautomaticallyremoved/destroyedaswell.Anotherimportant featureofcompositionaggregationisthatthepartclasscanonlybe relatedtooneinstanceoftheparentclass(e.g.theCompanyclass inourexample).

Reflexive associations Wehavenowdiscussedalltheassociationtypes.Asyoumayhave noticed,allourexampleshaveshownarelationshipbetweentwo differentclasses.However,aclasscanalsobeassociatedwithitself, usingareflexiveassociation.Thismaynotmakesenseatfirst,but rememberthatclassesareabstractions.Figure3.11showshowan Employeeclasscouldberelatedtoitselfthroughthe manager/managesrole.Whenaclassisassociatedtoitself,this doesnotmeanthataclass'sinstanceisrelatedtoitself,butthatan instanceoftheclassisrelatedtoanotherinstanceoftheclass.

Pg 31 Figure 3.11: Example of a reflexive association relationship TherelationshipdrawninFigure3.12meansthataninstanceof EmployeecanbethemanagerofanotherEmployeeinstance. However,becausetherelationshiproleof"manages"hasa multiplicityof0..*;anEmployeemightnothaveanyother Employeestomanage.

Pg 32

WEEKFour

Packages Inevitably,ifyouaremodellingalargesystemoralargeareaofa business,therewillbemanydifferentclassifiersinyourmodel. Managingalltheclassescanbeadauntingtask;therefore,UML providesanorganizingelementcalleda package .Packagesenable modellerstoorganizethemodel'sclassifiersintonamespaces, whichissortoflikefoldersinafilingsystem.Dividingasysteminto multiplepackagesmakesthesystemeasiertounderstand, especiallyifeachpackagerepresentsaspecificpartofthesystem. Therearetwowaysofdrawingpackagesondiagrams.Thereisno rulefordeterminingwhichnotationtouse,excepttouseyour personaljudgementregardingwhichiseasiesttoreadfortheclass diagramyouaredrawing.Bothwaysbeginwithalargerectangle withasmallerrectangle(tab)aboveitsupperleftcorner,asseenin Figure3.13.Butthemodellermustdecidehowthepackage's membershipistobeshown,asfollows:

• Ifthemodellerdecidestoshowthepackage'smemberswithin thelargerectangle,thenallthosemembersneedtobeplaced withintherectangle.Alsothepackage'snameneedstobe placedinthepackage'ssmallerrectangle(asshowninFigure 3.12).

• Ifthemodellerdecidestoshowthepackage'smembers outsidethelargerectanglethenallthemembersthatwillbe shownonthediagramneedtobeplacedoutsidethe rectangle.Toshowwhatclassifiersbelongtothepackage,a lineisdrawnfromeachclassifiertoacirclethathasaplus signinsidethecircleattachedtothepackage(Figure3.13).

Pg 33 Figure 3.12: An example package element that shows its members inside the package's rectangle boundaries

Pg 34 Figure 3.13: An example package element showing its membership via connected lines

Interfaces Earlierinthisarticle,itissuggestedthatyouthinkof classifiers simplyasclasses.Infact,aclassifierisamoregeneralconcept, whichincludesdatatypesandinterfaces. SowhydoImentiondatatypesandinterfaceshere?Thereare timeswhenyoumightwanttomodeltheseclassifiertypesona structurediagram,anditisimportanttousethepropernotationin doingso,oratleastbeawareoftheseclassifiertypes.Drawing theseclassifiersincorrectlywilllikelyconfusereadersofyour structurediagram,andtheensuingsystemwillprobablynotmeet requirements.

Pg 35 Aclassandaninterfacediffer:Aclasscanhaveanactualinstance ofitstype,whereasaninterfacemusthaveatleastoneclassto implementit.InUML2,aninterfaceisconsideredtobea specializationofaclassmodellingelement.Therefore,aninterface isdrawnjustlikeaclass,butthetopcompartmentoftherectangle alsohasthetext"«interface»",asshowninFigure3.14

Figure 3.14: Example of a class diagram in which the Professor and Student classes implement the Person interface InthediagramshowninFigure3.14,boththeProfessorand StudentclassesimplementthePersoninterfaceanddonotinherit fromit.Weknowthisfortworeasons: 1)ThePersonobjectisdefinedasaninterfaceithasthe "«interface»"textintheobject'snamearea,andweseethatthe ProfessorandStudentobjectsare class objectsbecausetheyare labelledaccordingtotherulesfordrawingaclassobject(thereis noadditionalclassificationtextintheirnamearea). 2)Weknowinheritanceisnotbeingshownhere,becausetheline withthearrowisdottedandnotsolid.AsshowninFigure3.15,a dotted linewithaclosed,unfilledarrowmeansrealization(or implementation);aswesawinFigure3.4,a solid arrowlinewitha closed,unfilledarrowmeansinheritance.

Visibility Inobjectorienteddesign,thereisanotationofvisibilityfor attributesandoperations.UMLidentifiesfourtypesofvisibility: public,protected,private,andpackage.

Pg 36 TheUMLspecificationdoesnotrequireattributesandoperations visibilitytobedisplayedontheclassdiagram,butitdoesrequire thatitbedefinedforeachattributeoroperation.Todisplayvisibility ontheclassdiagram,youplacethevisibilitymarkinfrontofthe attribute'soroperation'sname.ThoughUMLspecifiesfourvisibility types,anactualprogramminglanguagemayaddadditional visibilities,oritmaynotsupporttheUMLdefinedvisibilities.Table 3.4displaysthedifferentmarksfortheUMLsupportedvisibility types.

Table 3.4: Marks for UML-supported visibility types Mark Visibilitytype + Public # Protected Private ~ Package

Now,let'slookataclassthatshowsthevisibilitytypesindicatedfor itsattributesandoperations.InFigure3.15,alltheattributesand operationsarepublic,withtheexceptionoftheupdateBalance operation.TheupdateBalanceoperationisprotected.

Figure 3.15: A BankAccount class that shows the visibility of its attributes and operations

Instances Whenmodellingasystem'sstructureitissometimesusefultoshow exampleinstancesoftheclasses.Tomodelthis,UML2providesthe

Pg 37 instance specification element,whichshowsinterestinginformation usingexample(orreal)instancesinthesystem. Thenotationofaninstanceisthesameasaclass,butinsteadof thetopcompartmentmerelyhavingtheclass'sname,thenameis anunderlinedconcatenationof: InstanceName:ClassName Forexample: Donald:Person Becausethepurposeofshowinginstancesistoshowinterestingor relevantinformation,itisnotnecessarytoincludeinyourmodel theentireinstance'sattributesandoperations.Insteaditis completelyappropriatetoshowonlytheattributesandtheirvalues thatareinterestingasdepictedinFigure3.16.

Figure 3.16: An example instance of a Plane class (only the interesting attribute values are shown) However,merelyshowingsomeinstanceswithouttheirrelationship isnotveryuseful;therefore,UML2allowsforthemodellingofthe relationships/associationsattheinstancelevelaswell.Therulesfor drawingassociationsarethesameasfornormalclassrelationships, althoughthereisoneadditionalrequirementwhenmodellingthe associations.Theadditionalrestrictionisthatassociation relationshipsmustmatchtheclassdiagram'srelationshipsand thereforetheassociation'srolenamesmustalsomatchtheclass diagram.AnexampleofthisisshowninFigure3.17.Inthis exampletheinstancesareexampleinstancesoftheclassdiagram foundinFigure3.6.

Pg 38

Figure 3.17: An example of Figure 3.6 using instances instead of classes Figure3.17hastwoinstancesoftheFlightclassbecausetheclass diagramindicatedthattherelationshipbetweenthePlaneclassand theFlightclassis zero-to-many .Therefore,ourexampleshowsthe twoFlightinstancesthattheNX0337Planeinstanceisrelatedto.

Roles Modellingtheinstancesofclassesissometimesmoredetailedthan onemightwish.Sometimes,youmaysimplywanttomodela class'srelationshipatamoregenericlevel.Insuchcases,you shouldusethe role notation.Therolenotationisverysimilartothe instancesnotation.Tomodelaclass'srole,youdrawaboxand placetheclass'srolenameandclassnameinsideaswiththe instancesnotation,butinthiscaseyoudonotunderlinethewords. Figure3.18showsanexampleoftherolesplayedbytheEmployee classdescribedbythediagramatFigure3.11.InFigure3.18,we cantell,eventhoughtheEmployeeclassisrelatedtoitself,thatthe relationshipisreallybetweenanEmployeeplayingtheroleof managerandanEmployeeplayingtheroleofteammember.

Figure 3.18: A class diagram showing the class in Figure 14 in its different roles Notethatyoucannotmodelaclass'sroleonaplainclassdiagram, eventhoughFigure18makesitappearthatyoucan.Inorderto usetherolenotationyouwillneedtousetheInternalStructure notation,discussednext.

Pg 39 Internal Structures OneofthemoreusefulfeaturesofUML2structurediagramsisthe newinternalstructurenotation.Itallowsyoutoshowhowaclassor anotherclassifierisinternallycomposed.Thiswasnotpossiblein UML1.x,becausethenotationsetlimitedyoutoshowingonlythe aggregationrelationshipsthataclasshad.Now,inUML2,the internalstructurenotationletsyoumoreclearlyshowhowthat class'spartsrelatetoeachother. Let'slookatanexample.InFigure3.18wehaveaclassdiagram showinghowaPlaneclassiscomposedoffourenginesandtwo controlsoftwareobjects.Whatismissingfromthisdiagramisany informationabouthowairplanepartsareassembled.Fromthe diagraminFigure3.18,youcannottellifthecontrolsoftware objectscontroltwoengineseach,orifonecontrolsoftwareobject controlsthreeenginesandtheothercontrolsoneengine.

Figure 3.19: A class diagram that only shows relationships between the objects Drawingaclass'sinternalstructurewillimprovethissituation.You startbydrawingaboxwithtwocompartments.Thetop compartmentcontainstheclassname,andthelowercompartment containstheclass'sinternalstructure,showingtheparentclass's partclassesintheirrespectiveroles,aswellashoweachparticular classrelatestoothersinthatrole.Figure3.19showstheinternal structureofPlaneclass;noticehowtheinternalstructureclearsup theconfusion.

Pg 40 Figure3. 20: An example internal structure of a Plane class. InFigure3.20thePlanehastwoControlSoftwareobjectsandeach onecontrolstwoengines.TheControlSoftwareontheleftsideof thediagram(control1)controlsengines1and2.The ControlSoftwareontherightsideofthediagram(control2)controls engines3and4.

Conclusion Thereareatleasttwoimportantreasonsforunderstandingthe classdiagram. Thefirstisthatitshowsthestaticstructureofclassifiersina system;thesecondreasonisthatthediagramprovidesthebasic notationforotherstructurediagramsprescribedbyUML. Developerswillthinktheclassdiagramwascreatedspeciallyfor them;butotherteammemberswillfindthemuseful,too. Businessanalystscanuseclassdiagramstomodelsystemsfrom thebusinessperspective.

Pg 41

WEEK Five

COMPOSITE DIAGRAM

Introduction

Acompositestructurediagramisadiagramthatshowstheinternal structureofaclassifier,includingitsinteractionpointstoother partsofthesystem.Itshowstheconfigurationandrelationshipof parts,thattogether,performthebehaviorofthecontaining classifier. Classelementshavebeendescribedingreatdetailinthesectionon classdiagrams.Thissectiondescribesthewayclassescanbe displayedascompositeelementsexposinginterfacesandcontaining portsandparts.

Part Apartisanelementthatrepresentsasetofoneormoreinstances whichareownedbyacontainingclassifierinstance.Soforexample, ifadiagraminstanceownedasetofgraphicalelements,thenthe graphicalelementscouldberepresentedasparts;ifitwereuseful todoso,tomodelsomekindofrelationshipbetweenthem.Note thatapartcanberemovedfromitsparentbeforetheparentis deleted,sothatthepartisn'tdeletedatthesametime. Apartisshownasanunadornedrectanglecontainedwithinthe bodyofaclassorcomponentelement.

Pg 42

Port Aportisatypedelementthatrepresentsanexternallyvisiblepart ofacontainingclassifierinstance.Portsdefinetheinteraction betweenaclassifieranditsenvironment.Aportcanappearonthe boundaryofacontainedpart,aclassoracompositestructure.A portmayspecifytheservicesaclassifierprovidesaswellasthe servicesthatitrequiresofitsenvironment. Aportisshownasanamedrectangleontheboundaryedgeofits owningclassifier.

Pg 43 Interfaces Aninterfaceissimilartoaclassbutwithanumberofrestrictions. Allinterfaceoperationsarepublicandabstract,anddonotprovide anydefaultimplementation.Allinterfaceattributesmustbe constants.However,whileaclassmayonlyinheritfromasingle superclass,itmayimplementmultipleinterfaces. Aninterface,whenstandingaloneinadiagram,iseithershownas aclasselementrectanglewiththe«interface»keywordandwithits nameitalicizedtodenoteitisabstract,oritisshownasacircle.

Notethatthecirclenotationdoesnotshowtheinterfaceoperations. Wheninterfacesareshownasbeingownedbyclasses,theyare referredtoasexposedinterfaces.Anexposedinterfacecanbe definedaseitherprovidedorrequired.Aprovidedinterfaceisan affirmationthatthecontainingclassifiersuppliestheoperations definedbythenamedinterfaceelementandisdefinedbydrawinga realizationlinkbetweentheclassandtheinterface.Arequired interfaceisastatementthattheclassifierisabletocommunicate withsomeotherclassifierwhichprovidesoperationsdefinedbythe namedinterfaceelementandisdefinedbydrawingadependency linkbetweentheclassandtheinterface. Aprovidedinterfaceisshownasa"ballonastick"attachedtothe edgeofaclassifierelement.Arequiredinterfaceisshownasa"cup onastick"attachedtotheedgeofaclassifierelement.

Pg 44

Delegate Adelegateconnectorisusedfordefiningtheinternalworkingsofa component'sexternalportsandinterfaces.Adelegateconnectoris shownasanarrowwitha«delegate»keyword.Itconnectsan externalcontractofacomponentasshownbyitsportstothe internalrealizationofthebehaviorofthecomponent'spart.

Collaboration Acollaborationdefinesasetofcooperatingrolesusedcollectively toillustrateaspecificfunctionality.Acollaborationshouldonlyshow therolesandattributesrequiredtoaccomplishitsdefinedtaskor function.Isolatingtheprimaryrolesisanexerciseinsimplifyingthe structureandclarifyingthebehavior,andalsoprovidesforreuse.A

Pg 45 collaborationoftenimplementsapattern. Acollaborationelementisshownasanellipse.

Role Binding Arolebindingconnectorisdrawnfromacollaborationtothe classifierthatfulfilstherole.Itisshownasadashedlinewiththe nameoftheroleattheclassifierend.

Represents Arepresentsconnectormaybedrawnfromacollaborationtoa classifiertoshowthatacollaborationisusedintheclassifier.Itis shownasadashedlinewitharrowheadandthekeyword «represents».

Pg 46 Occurrence Anoccurrenceconnectormaybedrawnfromacollaborationtoa classifiertoshowthatacollaborationrepresents(sic)theclassifier. Itisshownasadashedlinewitharrowheadandthekeyword «occurrence».

Pg 47

WEEKSix

THE COMPONENT DIAGRAM ComponentDiagramdepictshowasoftwaresystemissplitupinto componentsandshowsthedependenciesamongthese components. Introduction Thecomponentdiagram'smainpurposeistoshowthestructural relationshipsbetweenthecomponentsofasystem.InUML1.1,a componentrepresentedimplementationitems,suchasfilesand executables.Unfortunately,thisconflictedwiththemorecommon useofthetermcomponent,"whichreferstothingssuchasCOM components.OvertimeandacrosssuccessivereleasesofUML,the originalUMLmeaningofcomponentswasmostlylost.UML2 officiallychangestheessentialmeaningofthecomponentconcept; inUML2,componentsareconsideredautonomous,encapsulated unitswithinasystemorsubsystemthatprovideoneormore interfaces.AlthoughtheUML2specificationdoesnotstrictlystate it,componentsarelargerdesignunitsthatrepresentthingsthatwill typicallybeimplementedusingreplaceable"modules.But,unlike UML1.x,componentsarenowstrictlylogical,designtime constructs.Theideaisthatyoucaneasilyreuseand/orsubstitutea differentcomponentimplementationinyourdesignsbecausea componentencapsulatesbehaviorandimplementsspecified interfaces. Incomponentbaseddevelopment(CBD),componentdiagrams offerarchitectsanaturalformattobeginmodellingasolution. Componentdiagramsallowanarchitecttoverifythatasystem's requiredfunctionalityisbeingimplementedbycomponents,thus ensuringthattheeventualsystemwillbeacceptable. Inaddition,componentdiagramsareusefulcommunicationtoolsfor variousgroups.Thediagramscanbepresentedtokeyproject stakeholdersandimplementationstaff.Whilecomponentdiagrams aregenerallygearedtowardsasystem'simplementationstaff, componentdiagramscangenerallyputstakeholdersatease becausethediagrampresentsanearlyunderstandingoftheoverall systemthatisbeingbuilt. Developersfindthecomponentdiagramusefulbecauseitprovides themwithahighlevel,architecturalviewofthesystemthatthey willbebuilding,whichhelpsdevelopersbeginformalizinga roadmapfortheimplementation,andmakedecisionsabouttask assignmentsand/orneededskillenhancements.System

Pg 48 administratorsfindcomponentdiagramsusefulbecausetheygetan earlyviewofthelogicalsoftwarecomponentsthatwillberunning ontheirsystems.Althoughsystemadministratorswillnotbeableto identifythephysicalmachinesorthephysicalexecutablesfromthe diagram,acomponentdiagramwillneverthelessbewelcomed becauseitprovidesearlyinformationaboutthecomponentsand theirrelationships(whichallowssysadminstolooselyplanahead). The notation Thecomponentdiagramnotationsetnowmakesitoneofthe easiestUMLdiagramstodraw.Figure6.1showsasimple componentdiagramusingtheformerUML1.4notation;the exampleshowsarelationshipbetweentwocomponents:anOrder SystemcomponentthatusestheInventorySystemcomponent.As youcansee,acomponentinUML1.4wasdrawnasarectangle withtwosmallerrectanglesprotrudingfromitsleftside.

Figure 5.1: This simple component diagram shows the Order System's general dependency using UML 1.4 notation TheaboveUML1.4notationisstillsupportedinUML2.However, theUML1.4notationsetdidnotscalewellinlargersystems.For thatreason,UML2dramaticallyenhancesthenotationsetofthe componentdiagram,aswewillseethroughouttherestofthis article.TheUML2notationsetscalesbetter,andthenotationsetis alsomoreinformativewhilemaintainingitseaseofunderstanding. Let'sstepthroughthecomponentdiagrambasicsaccordingtoUML 2.

Pg 49 The basics of Component Diagram DrawingacomponentinUML2isnowverysimilartodrawinga classonaclassdiagram.Infact,inUML2acomponentismerelya specializedversionoftheclassconcept.Whichmeansthatthe notationrulesthatapplytotheclassclassifieralsoapplytothe componentclassifier. InUML2,acomponentisdrawnasarectanglewithoptional compartmentsstackedvertically.Ahighlevel,abstractedviewofa componentinUML2canbemodelledasjustarectanglewiththe component'snameandthecomponentstereotypetextand/oricon. Thecomponentstereotype'stextis«component»"andthe componentstereotypeiconisarectanglewithtwosmaller rectanglesprotrudingonitsleftside(theUML1.4notationelement foracomponent).Figure6.2showsthreedifferentwaysa componentcanbedrawnusingtheUML2specification.

Figure 6.2: The different ways to draw a component's name compartment Whendrawingacomponentonadiagram,itisimportantthatyou alwaysincludethecomponentstereotypetext(theword "component"insidedoubleanglebrackets,asshowninFigure6.2) and/oricon.Thereason?InUML,arectanglewithoutany stereotypeclassifierisinterpretedasaclasselement.The componentstereotypeand/oricondistinguishesthisrectangleasa componentelement. Modelling a component's interfaces Provided/Required TheOrdercomponentsdrawninFigure6.2allrepresentvalid notationelements;however,atypicalcomponentdiagramincludes moreinformation.Acomponentelementcanhaveadditional compartmentsstackedbelowthenamecompartment.Asmentioned earlier,acomponentisanautonomousunitthatprovidesoneor morepublicinterfaces.Theinterfacesprovidedrepresenttheformal contractofservicesthecomponentprovidestoits consumers/clients.Figure6.3showstheOrdercomponenthavinga secondcompartmentthatdenoteswhatinterfacestheOrder componentprovidesandrequires.

Pg 50 Figure 6.3: The additional compartment here shows the interfaces that the Order component provides and requires. IntheexampleOrdercomponentshowninFigure6.3,the componentprovidestheinterfacesofOrderEntryand AccountPayable.Additionally,thecomponentalsorequiresanother componentthatprovidesthePersoninterface. Another approach to modelling a component's interfaces UML2hasalsointroducedanotherwaytoshowacomponent's providedandrequiredinterfaces.Thissecondwaybuildsoffthe singlerectangle,withthecomponent'snameinit,andplaceswhat theUML2specificationcallsinterfacesymbols"connectedtothe outsideoftherectangle.Thissecondapproachisillustratedin Figure6.4.

Figure 6.4: An alternative approach (compare with Figure 6.3) to showing a component's provided/required interfaces using interface symbols

Pg 51 Inthissecondapproachtheinterfacesymbolswithacompletecircle attheirendrepresentaninterfacethatthecomponentprovides thislollipop"symbolisshorthandforarealizationrelationshipofan interfaceclassifier.Interfacesymbolswithonlyahalfcircleattheir end(a.k.a.sockets)representaninterfacethatthecomponent requires(inbothcases,theinterface'snameisplacednearthe interfacesymbolitself).EventhoughFigure6.4looksmuch differentfromFigure6.3,bothfiguresprovidethesameinformation i.e.,theOrdercomponent provides twointerfaces:OrderEntry andAccountPayable,andtheOrdercomponent requires thePerson interface. Modelling a component's relationships Whenshowingacomponent'srelationshipwithothercomponents, thelollipopandsocketnotationmustalsoincludeadependency arrow(asusedintheclassdiagram).Onacomponentdiagramwith lollipopsandsockets,notethatthedependencyarrowcomesoutof theconsuming(requiring)socketanditsarrowheadconnectswith theprovider'slollipop,asshowninFigure6.5.

Figure 6.5: A component diagram that shows how the Order System component depends on other components Figure6.5showsthattheOrderSystemcomponentdependsboth ontheCustomerRepositoryandInventorySystemcomponents. NoticeinFigure6.5theduplicatednamesoftheinterfaces CustomerLookup"andProductAccessor."Whilethismayseem unnecessarilyrepetitiveinthisexample,thenotationactuallyallows fordifferentinterfaces(anddifferingnames)oneachcomponent dependingontheimplementationdifferences(e.g.,onecomponent providesaninterfacethatisasubclassofasmallerrequired interface). Subsystems

Pg 52 InUML2thesubsystemclassifierisaspecializedversionofa componentclassifier.Becauseofthis,thesubsystemnotation elementinheritsallthesamerulesasthecomponentnotation element.Theonlydifferenceisthatasubsystemnotationelement hasthekeywordofsubsystem"insteadofcomponent,"asshownin Figure6.6.

Figure 6.6: An example of a subsystem element TheUML2specificationisquitevagueonhowasubsystemis differentfromacomponent.Thespecificationdoesnottreata componentorasubsystemanydifferentlyfromamodelling perspective.ComparedwithUML1.x,thisUML2modelling ambiguityisnew.Butthere'sareason.InUML1.x,asubsystem wasconsideredapackage,andthispackagenotationwasconfusing tomanyUMLpractitioners;henceUML2alignedsubsystemsasa specializedcomponent,sincethisishowmostUML1.xusers understoodit.Thischangedidintroducefuzzinessintothepicture, butthisfuzzinessismoreofareflectionofrealityversusamistake intheUML2specification. TheUML2specificationsaysthatthedecisiononwhentousea componentversusasubsystemisuptothemethodologyofthe modeller. Showing a Component's Internal Structure Therewillbetimeswhenitmakessensetodisplayacomponent's internalstructure.Toshowacomponent'sinnerstructure,you merelydrawthecomponentlargerthannormalandplacetheinner partsinsidethenamecompartmentoftheencompassing component.Figure6.7show'stheStore'scomponentinner structure.

Pg 53

Figure 6.7: This component's inner structure is composed of other components. UsingtheexampleshowninFigure6.7,theStorecomponent providestheinterfaceofOrderEntryandrequirestheinterfaceof Account.TheStorecomponentismadeupofthreecomponents: Order,Customer,andProductcomponents.NoticehowtheStore's OrderEntryandAccountinterfacesymbolshaveasquareonthe edgeofthecomponent.Thissquareiscalledaport.Inasimplistic sense,portsprovideawaytomodelhowacomponent's provided/required interfacesrelatetoitsinternalparts.Byusinga port,ourdiagramisabletodecoupletheinternalsoftheStore componentfromexternalentities.InFigure6.7,theOrderEntry portdelegatestotheOrdercomponent'sOrderEntryinterfacefor processing.Also,theinternalCustomercomponent'srequired AccountinterfaceisdelegatedtotheStorecomponent'srequired Accountinterfaceport.ByconnectingtotheAccountport,the internalsoftheStorecomponent(e.g.theCustomercomponent) canhavealocalrepresentativeofsomeunknownexternalentity whichimplementstheport'sinterface.TherequiredAccount interfacewillbeimplementedbyacomponentoutsideoftheStore component. YouwillalsonoticeinFigure6.7thattheinterconnectionsbetween theinnercomponentsaredifferentfromthoseshowninFigure6.5. Thisisbecausethesedepictionsofinternalstructuresarereally collaborationdiagramsnestedinsidetheclassifier(acomponent,in ourcase),sincecollaborationdiagramsshowinstancesorrolesof classifiers.Therelationshipmodelledbetweentheinternal

Pg 54 componentsisdrawnwithwhatUMLcallsanassemblyconnector." Anassemblyconnectortiesonecomponent's provided interface withanothercomponent's requiredinterface.Assemblyconnectors aredrawnaslollipopandsocketsymbolsnexttoeachother. Drawingtheseassemblyconnectorsinthismannermakesthe lollipopandsocketsymbolsveryeasytoread. Conclusion Thecomponentdiagramisaveryimportantdiagramthatarchitects willoftencreateearlyinaproject.However,thecomponent diagram'susefulnessspansthelifeofthesystem.Component diagramsareinvaluablebecausetheymodelanddocumenta system'sarchitecture.Becausecomponentdiagramsdocumenta system'sarchitecture,thedevelopersandtheeventualsystem administratorsofthesystemfindthisworkproductcriticalin helpingthemunderstandthesystem. Componentdiagramsalsoserveasinputtoasoftwaresystem's deploymentdiagram.

Pg 55

WEEK Seven

OBJECT AND PACKAGE DIAGRAM

Object Diagrams Objectdiagram :showsacompleteorpartialviewofthestructureof amodelledsystemataspecifictime.Anobjectdiagrammaybe consideredaspecialcaseofaclassdiagram.Objectdiagramsusea subsetoftheelementsofaclassdiagraminordertoemphasizethe relationshipbetweeninstancesofclassesatsomepointintime.Theyare usefulinunderstandingclassdiagrams.Theydon’tshowanything architecturallydifferenttoclassdiagrams,butreflectmultiplicityand roles. Class and Object Elements Thefollowingdiagramshowsthedifferencesinappearancebetween aclasselementandanobjectelement.Notethattheclasselement consistsofthreeparts,beingdividedintoname,attributeand operationcompartments;bydefault,objectelementsdon’thave compartments.Thedisplayofnamesisalsodifferent:objectnames areunderlinedandmayshowthenameoftheclassifierfromwhich theobjectisinstantiated.

Run Time State Aclassifierelementcanhaveanynumberofattributesand operations.Thesearen’tshowninanobjectinstance.Itispossible, however,todefineanobject’sruntimestate,showingtheset valuesofattributesintheparticularinstance.

Pg 56

Example Class and Object Diagrams Thefollowingdiagramshowsanobjectdiagramwithitsdefining classdiagraminset,anditillustratesthewayinwhichanobject diagrammaybeusedtotestthemultiplicitiesofassignmentsin classdiagrams.Thecarclasshasa1tomanymultiplicitytothe wheelclass,butifa1to4multiplicityhadbeenchoseninstead, thatwouldn’thaveallowedforthethreewheeledcarshowninthe objectdiagram.

Pg 57 Package Diagrams Packagediagram depictshowasystemissplitupintological groupingsbyshowingthedependenciesamongthesegroupings. Packagediagramsareusedtoreflecttheorganizationofpackages andtheirelements.Whenusedtorepresentclasselements, packagediagramsprovideavisualizationofthenamespaces.The mostcommonuseforpackagediagramsistoorganizeusecase diagramsandclassdiagrams,althoughtheuseofpackage diagramsisnotlimitedtotheseUMLelements. Thefollowingisanexampleofapackagediagram.

Elementscontainedinapackagesharethesamenamespace. Therefore,theelementscontainedinaspecificnamespacemust haveuniquenames. Packagescanbebuilttorepresenteitherphysicalorlogical relationships.Whenchoosingtoincludeclassesinspecificpackages, itisusefultoassigntheclasseswiththesameinheritancehierarchy tothesamepackage.Thereisalsoastrongargumentforincluding classesthatarerelatedviacomposition,andclassesthat collaboratewiththem,inthesamepackage.

Pg 58 PackagesarerepresentedinUML2.1asfoldersandcontaintheelements thatshareanamespace;allelementswithinapackagemustbe identifiable,andsohaveauniquenameortype.Thepackagemustshow thepackagenameandcanoptionallyshowtheelementswithinthe packageinextracompartments.

Package Merge A«merge»connectorbetweentwopackagesdefinesanimplicit generalizationbetweenelementsinthesourcepackage,andelements withthesamenameinthetargetpackage.Thesourceelementdefinitions areexpandedtoincludetheelementdefinitionscontainedinthetarget. Thetargetelementdefinitionsareunaffected,asarethedefinitionsof sourcepackageelementsthatdon'tmatchnameswithanyelementinthe targetpackage.

Package Import The«import»connectorindicatesthattheelementswithinthetarget package,whichinthisexampleisasingleclass,useunqualifiednames whenbeingreferredtofromthesourcepackage.Thesourcepackage's namespacegainsaccesstothetargetclasses;thetarget'snamespaceis notaffected.

Nesting Connectors Thenestingconnectorbetweenthetargetpackageandsourcepackages showsthatthesourcepackageisfullycontainedinthetargetpackage.

Pg 59

WEEK Eight

DEPLOYMENT

Deployment Diagrams Deploymentdiagram servestomodelthehardwareusedinsystem implementations,thecomponentsdeployedonthehardware,and theassociationsamongthosecomponents. Adeploymentdiagrammodelstheruntimearchitectureofa system.Itshowstheconfigurationofthehardwareelements (nodes)andshowshowsoftwareelementsandartifactsaremapped ontothosenodes.

Node ANodeiseitherahardwareorsoftwareelement.Itisshownasa threedimensionalboxshape,asshownbelow.

Node Instance Anodeinstancecanbeshownonadiagram.Aninstancecanbe distinguishedfromanodebythefactthatitsnameisunderlinedandhas acolonbeforeitsbasenodetype.Aninstancemayormaynothavea namebeforethecolon.Thefollowingdiagramshowsanamedinstanceof acomputer.

Pg 60

Node Stereotypes Anumberofstandardstereotypesareprovidedfornodes,namely «cdrom»,«cdrom»,«computer»,«diskarray»,«pc»,«pcclient»,«pc server»,«secure»,«server»,«storage»,«unixserver»,«userpc».These willdisplayanappropriateiconinthetoprightcornerofthenodesymbol

Artifact Anartifactisaproductofthe softwaredevelopment process.Thatmay includeprocessmodels(e.g.usecasemodels,designmodelsetc),source files,executables,designdocuments,testreports,prototypes,user manuals,etc. Anartifactisdenotedbyarectangleshowingtheartifactname,the «artifact»keywordandadocumenticon,asshownbelow.

Pg 61 Association Inthecontextofadeploymentdiagram,anassociationrepresentsa communicationpathbetweennodes.Thefollowingdiagramshowsa deploymentdiagramforanetwork,depictingnetworkprotocolsas stereotypes,andmultiplicitiesattheassociationends.

Node as Container Anodecancontainotherelements,suchascomponentsorartifacts.The followingdiagramshowsadeploymentdiagramforpartofanembedded system,depictinganexecutableartifactasbeingcontainedbythe motherboardnode.

Pg 62

Pg 63

WEEKNine

THE BEHAVIOUR DIAGRAM TheBehaviordiagramsemphasizewhatmusthappeninthesystem beingmodelled:

Activity Diagrams InUML,anactivitydiagramisusedtodisplaythesequenceofactivities. Activitydiagramsshowtheworkflowfromastartpointtothefinishpoint detailingthemanydecisionpathsthatexistintheprogressionofevents containedintheactivity.Theymaybeusedtodetailsituationswhere parallelprocessingmayoccurintheexecutionofsomeactivities.Activity diagramsareusefulforbusinessmodellingwheretheyareusedfor detailingtheprocessesinvolvedinbusinessactivities.

Pg 64 AnExampleofanactivitydiagramisshownbelow.

Thefollowingsectionsdescribetheelementsthatconstitutean activitydiagram.

Activities Anactivityisthespecificationofaparameterizedsequenceofbehaviour. Anactivityisshownasaroundcorneredrectangleenclosingallthe actions,controlflowsandotherelementsthatmakeuptheactivity.

Pg 65

Actions Anactionrepresentsasinglestepwithinanactivity.Actionsaredenoted byroundcorneredrectangles.

Action Constraints Constraintscanbeattachedtoanaction.Thefollowingdiagramshowsan actionwithlocalpreandpostconditions.

Control Flow Acontrolflowshowstheflowofcontrolfromoneactiontothenext.Its notationisalinewithanarrowhead.

Pg 66

Initial Node Aninitialorstartnodeisdepictedbyalargeblackspot,asshownbelow.

Final Node Therearetwotypesoffinalnode:activityandflowfinalnodes.The activityfinalnodeisdepictedasacirclewithadotinside.

Theflowfinalnodeisdepictedasacirclewithacrossinside.

Pg 67 Thedifferencebetweenthetwonodetypesisthattheflowfinal nodedenotestheendofasinglecontrolflow;theactivityfinalnode denotestheendofallcontrolflowswithintheactivity.

Objects and Object Flows Anobjectflowisapathalongwhichobjectsordatacanpass.An objectisshownasarectangle.

Anobjectflowisshownasaconnectorwithanarrowheaddenoting thedirectiontheobjectisbeingpassed.

Anobjectflowmusthaveanobjectonatleastoneofitsends.A shorthandnotationfortheabovediagramwouldbetouseinputand outputpins.

Adatastoreisshownasanobjectwiththe«datastore»keyword.

Pg 68

Decision and Merge Nodes Decisionnodesandmergenodeshavethesamenotation:a diamondshape.Theycanbothbenamed.Thecontrolflowscoming awayfromadecisionnodewillhaveguardconditionswhichwill allowcontroltoflowiftheguardconditionismet.Thefollowing diagramshowsuseofadecisionnodeandamergenode.

Fork and Join Nodes Forksandjoinshavethesamenotation:eitherahorizontalor verticalbar(theorientationisdependentonwhetherthecontrol flowisrunninglefttorightortoptobottom).Theyindicatethe startandendofconcurrentthreadsofcontrol.Thefollowing diagramshowsanexampleoftheiruse.

Pg 69 Ajoinisdifferentfromamergeinthatthejoinsynchronizestwo inflowsandproducesasingleoutflow.Theoutflowfromajoin cannotexecuteuntilallinflowshavebeenreceived.Amergepasses anycontrolflowsstraightthroughit.Iftwoormoreinflowsare receivedbyamergesymbol,theactionpointedtobyitsoutflowis executedtwoormoretimes.

Expansion Region Anexpansionregionisastructuredactivityregionthatexecutes multipletimes.Inputandoutputexpansionnodesaredrawnasa groupofthreeboxesrepresentingamultipleselectionofitems.The keyword"iterative","parallel"or"stream"isshowninthetopleft corneroftheregion.

Exception Handlers ExceptionHandlerscanbemodelledonactivitydiagramsasinthe examplebelow.

Pg 70

Interruptible Activity Region Aninterruptibleactivityregionsurroundsagroupofactionsthat canbeinterrupted.Intheverysimpleexamplebelow,the"Process Order"actionwillexecuteuntilcompletion,whenitwillpasscontrol tothe"CloseOrder"action,unlessa"CancelRequest"interruptis received,whichwillpasscontroltothe"CancelOrder"action.

Partition Anactivitypartitionisshownaseitherahorizontalorvertical swimlane.Inthefollowingdiagram,thepartitionsareusedto separateactionswithinanactivityintothoseperformedbythe accountingdepartmentandthoseperformedbythecustomer.

Pg 71

Pg 72

WEEKTen

THE USE CASE MODEL Theusecasemodelcapturestherequirementsofasystem.Use casesareameansofcommunicatingwithusersandother stakeholderswhatthesystemisintendedtodo.

Usecasediagram showsthefunctionalityprovidedbyasystemin termsofactors,theirgoalsrepresentedasusecases,andany dependenciesamongthoseusecases. Use Case Model Actors Ausecasediagramshowstheinteractionbetweenthesystemand entitiesexternaltothesystem.Theseexternalentitiesarereferred toasactors.Actorsrepresentroleswhichmayincludehumanusers, externalhardwareorothersystems.Anactorisusuallydrawnasa namedstickfigure,oralternativelyasaclassrectanglewiththe «actor»keyword.

Pg 73 Actorscangeneralizeotheractorsasdetailedinthefollowing diagram:

Use Cases Ausecaseisasingleunitofmeaningfulwork.Itprovidesahighlevel viewofbehaviorobservabletosomeoneorsomethingoutsidethesystem. Thenotationforausecaseisanellipse.

Thenotationforusingausecaseisaconnectinglinewithan optionalarrowheadshowingthedirectionofcontrol.Thefollowing diagramindicatesthattheactor"Customer"usesthe"Withdraw" usecase.

Pg 74 Theusesconnectorcanoptionallyhavemultiplicityvaluesateach end,asinthefollowingdiagram,whichshowsacustomermayonly haveonewithdrawalsessionatatime,butabankmayhaveany numberofcustomersmakingwithdrawalsconcurrently.

Use Case Definition AusecasetypicallyIncludes: • Nameanddescription • Requirements • Constraints • Scenarios • Scenariodiagrams • Additionalinformation.

Name and Description Ausecaseisnormallynamedasaverbphraseandgivenabriefinformal textualdescription. Requirements Therequirementsdefinetheformalfunctionalrequirementsthatause casemustsupplytotheenduser.Theycorrespondtothefunctional specificationsfoundinstructuredmethodologies.Arequirementisa contractorpromisethattheusecasewillperformanactionorprovide somevaluetothesystem.

Pg 75 Constraints Aconstraintisaconditionorrestrictionthatausecaseoperatesunder andincludespre,postandinvariantconditions.Apreconditionspecifies theconditionsthatneedtobemetbeforetheusecasecanproceed.A postconditionisusedtodocumentthechangeinconditionsthatmustbe trueaftertheexecutionoftheusecase.Aninvariantconditionspecifies theconditionsthataretruethroughouttheexecutionoftheusecase .

Scenarios AScenarioisaformaldescriptionoftheflowofeventsthatoccurduring theexecutionofausecaseinstance.Itdefinesthespecificsequenceof eventsbetweenthesystemandtheexternalactors.Itisnormally describedintextandcorrespondstothetextualrepresentationofthe sequencediagram.

Including Use Cases Usecasesmaycontainthefunctionalityofanotherusecaseaspartof theirnormalprocessing.Ingeneralitisassumedthatanyincludeduse casewillbecalledeverytimethebasicpathisrun.Anexampleofthisis tohavetheexecutionoftheusecasetoberunas partofausecase.

UseCasesmaybeincludedbyoneormoreUseCase,helpingto reducethelevelofduplicationoffunctionalitybyfactoringout commonbehaviorintoUseCasesthatarereusedmanytimes.

Extending Use Cases Oneusecasemaybeusedtoextendthebehaviorofanother;this istypicallyusedinexceptionalcircumstances.Forexample,if beforemodifyingaparticulartypeofcustomerorder,ausermust getapprovalfromsomehigherauthority,thenthe usecasemayoptionallyextendtheregularuse case.

Pg 76

Extension Points Thepointatwhichanextendingusecaseisaddedcanbedefined bymeansofanextensionpoint.

System Boundary Itisusualtodisplayusecasesasbeinginsidethesystemand actorsasbeingoutsidethesystem.

Pg 77

Pg 78

WEEKEleven

THE STATE MACHINE MODEL Astatemachinediagrammodelsthebehaviourofasingleobject, specifyingthesequenceofeventsthatanobjectgoesthrough duringitslifetimeinresponsetoevents.

Statediagram standardizednotationtodescribemanysystems, fromcomputerprogramstobusinessprocesses. Asanexample,thefollowingstatemachinediagramshowsthe statesthatadoorgoesthroughduringitslifetime.

Thedoorcanbeinoneofthreestates:"Opened","Closed"or "Locked".ItcanrespondtotheeventsOpen,Close,Lockand Unlock.Noticethatnotalleventsarevalidinallstates;for example,ifadoorisopened,youcannotlockituntilyoucloseit. Alsonoticethatastatetransitioncanhaveaguardcondition attached:ifthedoorisOpened,itcanonlyrespondtotheClose eventiftheconditiondoorWay>isEmptyisfulfilled.Thesyntaxand conventionsusedinstatemachinediagramswillbediscussedinfull inthefollowingsections. States Astateisdenotedbyaroundcorneredrectanglewiththenameof thestatewritteninsideit.

Pg 79

Initial and Final States Theinitialstateisdenotedbyafilledblackcircleandmaybe labelledwithaname.Thefinalstateisdenotedbyacirclewitha dotinsideandmayalsobelabelledwithaname.

Transitions Transitionsfromonestatetothenextaredenotedbylineswith arrowheads.Atransitionmayhaveatrigger,aguardandaneffect, asbelow.

"Trigger"isthecauseofthetransition,whichcouldbeasignal,an event,achangeinsomecondition,orthepassageoftime."Guard" isaconditionwhichmustbetrueinorderforthetriggertocause thetransition."Effect"isanactionwhichwillbeinvokeddirectlyon theobjectthatownsthestatemachineasaresultofthetransition.

Pg 80 State Actions Inthetransitionexampleabove,aneffectwasassociatedwiththe transition.Ifthetargetstatehadmanytransitionsarrivingatit,and eachtransitionhadthesameeffectassociatedwithit,itwouldbe bettertoassociatetheeffectwiththetargetstateratherthanthe transitions.Thiscanbedonebydefininganentryactionforthe state.Thediagrambelowshowsastatewithanentryactionandan exitaction.

Itisalsopossibletodefineactionsthatoccuronevents,oractions thatalwaysoccur.Itispossibletodefineanynumberofactionsof eachtype.

Self-Transitions Astatecanhaveatransitionthatreturnstoitself,asinthe followingdiagram.Thisismostusefulwhenaneffectisassociated withthetransition.

Pg 81 Compound States Astatemachinediagrammayincludesubmachinediagrams,asin theexamplebelow.

Thealternativewaytoshowthesameinformationisasfollows.

Pg 82 Thenotationintheaboveversionindicatesthatthedetailsofthe CheckPINsubmachineareshowninaseparatediagram.

Entry Point Sometimesyouwon’twanttoenterasubmachineatthenormal initialstate.Forexample,inthefollowingsubmachineitwouldbe normaltobegininthe"Initializing"state,butifforsomereasonit wasn’tnecessarytoperformtheinitialization,itwouldbepossible tobegininthe"Ready"statebytransitioningtothenamedentry point.

Pg 83 Thefollowingdiagramshowsthestatemachineonelevelup.

Exit Point Inasimilarmannertoentrypoints,itispossibletohavenamed alternativeexitpoints.Thefollowingdiagramgivesanexample wherethestateexecutedafterthemainprocessingstatedepends onwhichrouteisusedtotransitionoutofthestate.

Pg 84

Choice Pseudo-State Achoicepseudostateisshownasadiamondwithonetransition arrivingandtwoormoretransitionsleaving.Thefollowingdiagram showsthatwhicheverstateisarrivedat,afterthechoicepseudo state,isdependentonthemessageformatselectedduring executionofthepreviousstate.

Junction Pseudo-State Junctionpseudostatesareusedtochaintogethermultiple

Pg 85 transitions.Asinglejunctioncanhaveoneormoreincoming,and oneormoreoutgoing,transitions;aguardcanbeappliedtoeach transition.Junctionsaresemanticfree.Ajunctionwhichsplitsan incomingtransitionintomultipleoutgoingtransitionsrealizesa staticconditionalbranch,asopposedtoachoicepseudostate whichrealizesadynamicconditionalbranch.

Terminate Pseudo-State Enteringaterminatepseudostateindicatesthatthelifelineofthe statemachinehasended.Aterminatepseudostateisnotatedasa cross.

History States Ahistorystateisusedtorememberthepreviousstateofastate

Pg 86 machinewhenitwasinterrupted.Thefollowingdiagramillustrates theuseofhistorystates.Theexampleisastatemachinebelonging toawashingmachine.

Inthisstatemachine,whenawashingmachineisrunning,itwill progressfrom"Washing"through"Rinsing"to"Spinning".Ifthereis apowercut,thewashingmachinewillstoprunningandwillgoto the"PowerOff"state.Thenwhenthepowerisrestored,the Runningstateisenteredatthe"HistoryState"symbolmeaningthat itshouldresumewhereitlastleftoff.

Concurrent Regions Astatemaybedividedintoregionscontainingsubstatesthatexist andexecuteconcurrently.Theexamplebelowshowsthatwithinthe state"ApplyingBrakes",thefrontandrearbrakeswillbeoperating simultaneouslyandindependently.Noticetheuseofforkandjoin pseudostates,ratherthanchoiceandmergepseudostates.These symbolsareusedtosynchronizetheconcurrentthreads.

Pg 87

Pg 88

WEEKTwelve

THE INTERACTION DIAGRAM

Interactiondiagrams,asubsetofbehaviordiagrams,emphasizethe flowofcontrolanddataamongthethingsinthesystembeing modelled:ItcompriseofCommunication,Interaction,Sequenceand Timingdiagrams. Communication Diagrams Acommunicationdiagram,formerlycalledacollaborationdiagram,isan interactiondiagramthatshowssimilarinformationtosequencediagrams butitsprimaryfocusisonobjectrelationships. Communicationdiagram showstheinteractionsbetweenobjectsor partsintermsofsequencedmessages.Theyrepresenta combinationofinformationtakenfromClass,Sequence,andUse CaseDiagramsdescribingboththestaticstructureanddynamic behaviorofasystem. Oncommunicationdiagrams,objectsareshownwithassociation connectorsbetweenthem.Messagesareaddedtotheassociationsand showasshortarrowspointinginthedirectionofthemessageflow.The sequenceofmessagesisshownthroughanumberingscheme. Thefollowingtwodiagramsshowacommunicationdiagramandthe sequencediagramthatshowsthesameinformation.Althoughitis possibletoderivethesequencingofmessagesinthecommunication diagramfromthenumberingscheme,itisn’timmediatelyvisible.What thecommunicationdiagramdoesshowquiteclearlythough,isthefullset ofmessagespassedbetweenadjacentobjects.

Pg 89

Pg 90

SEQUENCE DIAGRAMS Asequencediagramisaformofinteractiondiagramwhichshowsobjects aslifelinesrunningdownthepage,withtheirinteractionsovertime representedasmessagesdrawnasarrowsfromthesourcelifelinetothe targetlifeline.

The diagram's purpose

The sequence diagram is used primarily to show the interactions between objects in the sequential order that those interactions occur. Much like the class diagram, developers typically think sequence diagrams were meant exclusively for them. However, an organization's business staff can find sequence diagrams useful to communicate how the business currently works by showing how various business objects interact. Besides documenting an organization's current affairs, a business- level sequence diagram can be used as a requirements document to communicate requirements for a future system implementation. During the requirements phase of a project, analysts can take use cases to the next level by providing a more formal level of refinement. When that occurs, use cases are often refined into one or more sequence diagrams. equenceofmessages.Alsoindicatesthelifespansofobjectsrelative tothosemessages.

Sequencediagramsaregoodatshowingwhichobjectscommunicatewith whichotherobjects;andwhatmessagestriggerthosecommunications. Sequencediagramsarenotintendedforshowingcomplexprocedural logic.

Lifelines Alifelinerepresentsanindividualparticipantinasequencediagram.A lifelinewillusuallyhavearectanglecontainingitsobjectname.Ifitsname is"self",thatindicatesthatthelifelinerepresentstheclassifierwhich ownsthesequencediagram.

Pg 91

Sometimesasequencediagramwillhavealifelinewithanactor elementsymbolatitshead.Thiswillusuallybethecaseifthe sequencediagramisownedbyausecase.Boundary,controland entityelementsfromrobustnessdiagramscanalsoownlifelines.

Messages Messagesaredisplayedasarrows.Messagescanbecomplete,lostor found;synchronousorasynchronous;callorsignal.Inthefollowing diagram,thefirstmessageisasynchronousmessage(denotedbythe solidarrowhead)completewithanimplicitreturnmessage;thesecond messageisasynchronous(denotedbylinearrowhead),andthethirdis theasynchronousreturnmessage(denotedbythedashedline).

Pg 92

Execution Occurrence Athinrectanglerunningdownthelifelinedenotestheexecution occurrence,oractivationofafocusofcontrol.Inthepreviousdiagram, therearethreeexecutionoccurrences.Thefirstisthesourceobject sendingtwomessagesandreceivingtworeplies;thesecondisthetarget objectreceivingasynchronousmessageandreturningareply;andthe thirdisthetargetobjectreceivinganasynchronousmessageand returningareply.

Self Message Aselfmessagecanrepresentarecursivecallofanoperation,orone methodcallinganothermethodbelongingtothesameobject.Itisshown ascreatinganestedfocusofcontrolinthelifeline’sexecutionoccurrence.

Pg 93

Lost and Found Messages Lostmessagesarethosethatareeithersentbutdonotarriveatthe intendedrecipient,orwhichgotoarecipientnotshownonthecurrent diagram.Foundmessagesarethosethatarrivefromanunknownsender, orfromasendernotshownonthecurrentdiagram.Theyaredenoted goingtoorcomingfromanendpointelement.

Lifeline Start and End Alifelinemaybecreatedordestroyedduringthetimescalerepresented

Pg 94 byasequencediagram.Inthelattercase,thelifelineisterminatedbya stopsymbol,representedasacross.Intheformercase,thesymbolat theheadofthelifelineisshownatalowerleveldownthepagethanthe symboloftheobjectthatcausedthecreation.Thefollowingdiagram showsanobjectbeingcreatedanddestroyed.

Duration and Time Constraints Bydefault,amessageisshownasahorizontalline.Sincethelifeline representsthepassageoftimedownthescreen,whenmodellingareal timesystem,orevenatimeboundbusinessprocess,itcanbeimportant toconsiderthelengthoftimeittakestoperformactions.Bysettinga durationconstraintforamessage,themessagewillbeshownasasloping line.

Pg 95

Combined Fragments

Itwasstatedearlierthatsequencediagramsarenotintendedforshowing complexprocedurallogic.Whilethisisthecase,thereareanumberof mechanismsthatdoallowforaddingadegreeofprocedurallogicto diagramsandwhichcomeundertheheadingofcombinedfragments.A combinedfragmentisoneormoreprocessingsequenceenclosedina frameandexecutedunderspecificnamedcircumstances.Thefragments availableare:

• Alternativefragment(denoted“alt”)modelsif…then…else constructs. • Optionfragment(denoted“opt”)modelsswitchconstructs. • Breakfragmentmodelsanalternativesequenceofeventsthat isprocessedinsteadofthewholeoftherestofthediagram. • Parallelfragment(denoted“par”)modelsconcurrent processing. • Weaksequencingfragment(denoted“seq”)enclosesa numberofsequencesforwhichallthemessagesmustbe processedinaprecedingsegmentbeforethefollowing segmentcanstart,butwhichdoesnotimposeanysequencing withinasegmentonmessagesthatdon’tsharealifeline.

Pg 96 • Strictsequencingfragment(denoted“strict”)enclosesa seriesofmessageswhichmustbeprocessedinthegiven order. • Negativefragment(denoted“neg”)enclosesaninvalidseries ofmessages. • Criticalfragmentenclosesacriticalsection. • Ignorefragmentdeclaresamessageormessagetobeofno interestifitappearsinthecurrentcontext. • Considerfragmentisineffecttheoppositeoftheignore fragment:anymessagenotincludedintheconsiderfragment shouldbeignored. • Assertionfragment(denoted“assert”)designatesthatany sequencenotshownasanoperandoftheassertionisinvalid. • Loopfragmentenclosesaseriesofmessageswhichare repeated.

Thefollowingdiagramshowsaloopfragment.

Pg 97

Thereisalsoaninteractionoccurrence,whichissimilartoa combinedfragment.Aninteractionoccurrenceisareferenceto anotherdiagramwhichhastheword"ref"inthetopleftcornerof theframe,andhasthenameofthereferenceddiagramshownin themiddleoftheframe.

Gate Agateisaconnectionpointforconnectingamessageinsideafragment withamessageoutsideafragment.EAshowsagateasasmallsquareon afragmentframe.Diagramgatesactasoffpageconnectorsforsequence diagrams,representingthesourceofincomingmessagesorthetargetof outgoingmessages.Thefollowingtwodiagramsshowhowtheymightbe usedinpractice.Notethatthegateonthetopleveldiagramisthepoint atwhichthemessagearrowheadtouchesthereferencefragmentthere isnoneedtorenderitasaboxshape.

Pg 98

Part Decomposition Anobjectcanhavemorethanonelifelinecomingfromit.Thisallowsfor interandintraobjectmessagestobedisplayedonthesamediagram.

Pg 99 State Invariant / Continuations Astateinvariantisaconstraintplacedonalifelinethatmustbetrueat runtime.Itisshownasarectanglewithsemicircularends.

Acontinuationhasthesamenotationasastateinvariant,butis usedincombinedfragmentsandcanstretchacrossmorethanone lifeline.

Pg 100

WEEKThirteen

THE INTERACTION OVERVIEW DIAGRAM Aninteractionoverviewdiagramisaformofactivitydiagramin whichthenodesrepresentinteractiondiagrams. Interactiondiagramscanincludesequence,communication, interactionoverviewandtimingdiagrams.Mostofthenotationfor interactionoverviewdiagramsisthesameforactivitydiagrams.For example,initial,final,decision,merge,forkandjoinnodesareall thesame.However,interactionoverviewdiagramsintroducetwo newelements:interactionoccurrencesandinteractionelements.

Interaction Occurrence Interactionoccurrencesarereferencestoexistinginteraction diagrams.Aninteractionoccurrenceisshownasareferenceframe; thatis,aframewith"ref"inthetopleftcorner.Thenameofthe diagrambeingreferencedisshowninthecenteroftheframe.

Interaction Element Interactionelementsaresimilartointeractionoccurrences,inthat theydisplayarepresentationofexistinginteractiondiagramswithin arectangularframe.Theydifferinthattheydisplaythecontentsof thereferencesdiagraminline.

Pg 101

Putting it all Together Allthesamecontrolsfromactivitydiagrams(fork,join,merge, etc.)canbeusedoninteractionoverviewdiagramstoputthe controllogicaroundthelowerleveldiagrams.Thefollowing exampledepictsasamplesaleprocess,withsubprocesses abstractedwithininteractionoccurrences.

Pg 102

Pg 103 THE TIMING DIAGRAM Theseareaspecifictypeofinteractiondiagram,wherethefocusis ontimingconstraints. UMLtimingdiagramsareusedtodisplaythechangeinstateor valueofoneormoreelementsovertime.Itcanalsoshowthe interactionbetweentimedeventsandthetimeandduration constraintsthatgovernthem.

State Lifeline Astatelifelineshowsthechangeofstateofanitemovertime.The Xaxisdisplayselapsedtimeinwhateverunitsarechosen,whilethe Yaxisislabelledwithagivenlistofstates.Astatelifelineisshown below.

Value Lifeline Avaluelifelineshowsthechangeofvalueofanitemovertime.TheX axisdisplayselapsedtimeinwhateverunitsarechosen,thesameasfor thestatelifeline.Thevalueisshownbetweenthepairofhorizontallines whichcrossoverateachchangeinvalue.Avaluelifelineisshownbelow.

Pg 104

Putting it all Together StateandvalueLifelinescanbestackedoneontopofanotherinany combination.TheymusthavethesameXaxis.Messagescanbepassed fromonelifelinetoanother.Eachstateorvaluetransitioncanhavea definedevent,atimeconstraintwhichindicateswhenaneventmust occur,andadurationconstraintwhichindicateshowlongastateorvalue mustbeineffectfor.Oncethesehaveallbeenapplied,atimingdiagram maylooklikethefollowing.

Pg 105

WEEK Fourteen

THE UML TOOLS

Introduction SofarwehavedefinedandgainedanoverviewofwhattheUnified ModellingLanguagestandsforandwhatallthediagramsthatmake upUMLmean.BecauseUMLisessentiallyasetofdiagrams,you cansimplydrawthembyhandonapieceofpaper.But,drawing UMLdiagramsonapieceofpaperiscertainlynotabestpracticeto designsystems.Softwareapplicationssimplifythetaskofdrawing diagramsofsoftwaredesigns.Inaddition,becausethedesignisin anelectronicformat,archivingthedesignforfutureuse, collaboratingonthedesignbecomesmucheasier.Also,routine taskscanbeautomatedbyusingaUMLtool.Hence,usingaUML toolisbyfarthemostpreferredwayfordesigningsoftware applications. Features in UML Tools Thistakesustoanimportantquestion—whatexactlyshouldwe lookforinaUMLtool? BecausetheprimaryuseofaUMLtoolistoenableyoutodraw diagrams,firstandforemost,weneedtoseewhattypesofUML diagramsthetoolsupports.But,isdrawingUMLdiagramsallthat youwouldexpectfromaUMLtool?Forexample,wouldn'titbe greatiftheclassdiagramsthatyoudrawinthetoolcansomehow beusedtogeneratethesourcecodeforactualJavaclassesorC++ classes? Letustakealookatanotherscenario.Supposeyouweregivena largesetofsourcecodefileswithlotsandlotsofclasses.Wouldn't itbeanightmarewadingthroughthecodetryingtofigureouthow alltheclassesareinterconnected?ThisiswhereUMLtoolsstepin tomakethingsaloteasierbyprovidingsupportforsuchfeatures. Now,let'sdefinethesefeaturesintechnicalterms: • UML diagram support: TheUMLtoolshouldsupportallthe diagramsthatmakeupUML.Youshouldlookforatoolthat supportsdrawingusecases,designingthestaticview diagramssuchasclassdiagramsandobjectdiagrams, definingthedynamicviewdiagramssuchassequence,

Pg 106 activity,state,andcollaborationdiagramsandthecomponent anddeploymentdiagramsthatformtheimplementationview ofthesystem. • Forward engineering: AUMLtoolshouldnothaveitsuse limitedtojustapictorialdepictionofdiagrams.Becausethe structureofthesystemdefinedbythediagramistranslated byadeveloperintoactualsourcecode(classes),theUMLtool shouldbridgethisstepbygeneratingthesourcecodeofthe classeswiththemethodsstubbedout.Developerscantake upthisstubcodeandfillinwiththeactualcode.This characteristicofautomatingthegenerationofsourcecodeis calledforwardengineering.Forwardengineeringsupportbya UMLtoolisnormallyforaspecificlanguageorasetof languages.IfyouareaJavadeveloper,verifythattheUML toolthatyouwanttousehasforwardengineeringsupportfor Java.Similarly,ifyouareaC++developer,theUMLtool shouldprovideyouforwardengineeringsupportforC++. • Reverse engineering: Reverseengineeringisexactlythe oppositeofforwardengineering.Inreverseengineering,the UMLtoolloadsallthefilesoftheapplication/system,identifies dependenciesbetweenthevariousclasses,andessentially reconstructstheentireapplicationstructurealongwithallthe relationshipsbetweentheclasses.Reverseengineeringisa featurenormallyprovidedbysophisticatedandhighendUML tools. • Round-trip engineering: Anotherusefulfeatureapartfrom forwardandreverseengineeringisroundtripengineering. Forwardandreverseengineeringareessentiallyoneoff activitiesthattakeinputandgeneratetherequiredoutput. Roundtripengineeringextendsthesefeatures. Animportantruleinsoftwaredesignisthatnodesignremains unchanged.Thisisastrueforsmallsystemsasitisforlarge systems.Duringdevelopment,thedesignstructuredefinedin theUMLmodeldoesundergochangestoincorporatephysical differencesinimplementationthatmaynothavebeen envisagedduringdesign.Itbecomesverydifficulttokeepthe designofthesystemupdatedwiththechangesinthesource code.TheroundtripengineeringfeatureenablestheUMLtool tosynchronizethemodelwiththechangesintheapplication code. • Documentation: Documentationisanintegralaspectofa UMLtool.Softwaredesigning,bynature,isanabstract

Pg 107 process.Apartfromafewsyntaxandsemanticgroundrules, therearenootherrules.Thethoughtprocessofasoftware architectwhodesignsapplicationsusingUMLcanbelostifthe reasonsbehindcertaindesigndecisionsarenotcapturedand welldocumented.Thisbecomespainfullyclearwhenlarge systemsaremaintainedandnoonehasacluetowhya subsystemwasdesignedinacertainway.Hence,aUMLtool mustnecessarilyprovidesomewayforthedesignerto documentdesigndecisionsinthediagramsbyusingsimple thingssuchasannotationsorcomments.Inadditiontothis, theUMLtoolshouldsupportthegenerationofreports/listings ofthedifferentdesignelementsofthediagram. Apartfromtheabovefeatures,youshouldalsoidentifyafew featuresthatwoulddefinitelybeusefultohaveintheUML tool. • Version control: Averyimportantfeaturethatwewantto haveintheUMLtooliseitheranintegratedversioncontrol mechanismorconnectivitytoastandardversioncontrol system.Configurationmanagementisanintegralpartinthe buildingofsoftwaresystems.Consideringthatthedesignofa systemisaveryimportantartefactofthesoftwarelifecycle, maintainingversionsandbaselinesofthesystemdesignisa desirablefeaturetohaveinUMLtools.Intheabsenceof directsupportforversioncontrol,itistheresponsibilityofthe designertomaintainversionsofthedesign. • Collaborative modelling environment: Enterprisesystems arehugeandtheirdesignsarequitecomplex.Whiledesigning complexsystems,theremaybedifferentteamsinvolvedand maycarryoutdesignworkondifferentsubsystemsinparallel. Thiscollaborativedesigneffortneedstobeproperly synchronizedbytheUMLtool.TheUMLtoolshouldprovide supportforacollaborativemodellingenvironmentwith capabilitytocomparedifferentversionsdesignsfor differencesorevenmergedifferentversionsofadesign. Collaborativemodellingisalwaysanicefeaturetohavein UMLtools. • Integration with popular Integrated Development Environments (IDE): Withtheincreasinguseofiterative methodologiesforbuildingsoftwaresystems,itbecomesvery difficulttokeepthedesignofthesysteminsyncwiththe developedcode.Hence,itwouldbeusefuliftheUMLtool providesintegrationwithpopularIDEs.Thisfeaturewould enabletheUMLtooltobeupdatedwiththechangesinthe sourcecodemadeintheIDE.

Pg 108 • Test script generation: Thesystemorsubsystemdesigned inaUMLtoolmayrepresentasetoffunctionalaspectsas well.Hence,itwouldbereallyusefulif,inadditionto generatingstubcode,thetoolalsogeneratestestscriptsthat canbeusedfortestinghowthegeneratedclassfunctions. • Model View Controller (MVC) modelling: Enterprise applicationarchitectureshaveincreasinglybegunto standardizeandarebasedontheModelViewController architecture.Hence,ifyoudesignntier,Webenabled enterpriseapplications,youshouldlookforaUMLtoolthat supportsdesigningapplicationsbasedontheMVC architecture.SupportforMVCmodellingmakesiteasierto organizeandclearlydistinguishthedesignelementsalongthe linesoftheMVClayers.Thiswillhelpinthelongrunin improvingthereadabilityofthemodel. Template-driven modelling Reusabilityisthekeytoimprovingproductivity.Anapplication designmayconsistofseveralclasseswithrelationshipsdefined. Quiteafewtimes,whiledesigningapplications,youencounterthe samedesignproblemsorscenariosandendupdefiningthesame designagainandagain.Byusingamodellingtool,youcandefine certaincomponentsorevensubsystemsthatmightpotentiallybe reusableinthefuture.Forexample,designelementsofan applicationusedtodefineaccesstothedatabaseusing,say,a ConnectionPoolclassarepotentiallyreusable.Youmightneedto defineasimilardatabaseconnectionpoolinanotherapplicationas well.Hence,itwouldbenefitusinthelongrunifwedesignthe ConnectionPoolclassseparately.Wethencanincludethe ConnectionPooldesigninanyfuturesubsystemsa ndavoidtheneed ofreinventingthewheel. Suchreusabledesignsormodelsaretermedastemplatesandthe entiremodelingprocessinvolvingtheidentificationanduseof templatesiscalledtemplatedrivenmodeling.Thebenefitsof templatedrivenmodelingareapparentinthesavingsindesign time.Youcanconsidermodeltemplatestobeverysimilarto reusablecodelibrariesusedinapplicationdevelopment.

Popular UML Tools Wewilllisthereafewofthe"moversandshakers"ofvendorsof UMLtools. • Rational Rose: NodiscussionofUMLtoolsiscomplete withoutthementionoftheRationalRosemodellingtoolfrom

Pg 109 RationalSoftwareCorporation.RationalRose(theRosestands for"RationalObjectorientedSoftwareEngineering")isa visualmodellingtoolforUML.Itcomesindifferentversions suitedtodifferentrequirements.RationalRoseprovides supportforallthestandardfeaturesthatwediscussedinthe previoussectionsuchasUMLdiagramsupport,forwardand reverseengineeringsupport,anddocumentationandround tripengineeringsupport.Apartfromthis,RationalRosealso providessupportforversioncontrol,IDEintegration,design patternmodelling,testscriptgeneration,andcollaborative modellingenvironment.Inaddition,RationalRosealso supportsthedesigningofdatamodelswithinthesame environment.AninterestingfeatureofRationalRoseisthe abilitytopublishtheUMLdiagramsasasetofWebpagesand images.Thisenablesyoutoshareanddistributeyour applicationdesignwheretheRationalRosetoolisnot installed. • Together Control Center: TogetherControlCenter(formerly fromTogethersoft)fromBorlandisanentiresuiteofvisual modellingtoolsforUML.TogetherControlCentersupports UMLdiagrams,MVCmodelling,forwardandreverse engineering,androundtripengineering,aswellas integrationwithIDEssuchasIBMWebSphereStudio. Itsupportscomprehensivedocumentationandapowerful collaborativemodellingenvironment. AnaddedfeatureofTogetherControlCenteristhepattern repository.Thepatternrepository(similartothetemplate drivenmodellingconceptdiscussedabove)makesfrequently useddiagramsanddesignpatternsreadilyavailableforreuse inmodelling.TogetherControlCentersupportstheRational UnifiedProcessaswellastheeXtremeProgramming methodologies. • Poseidon: PoseidonfromGentlewarehasitsrootsinthe ArgoUMLopensourceproject.TheArgoUMLmodelingtool evolvedasanopensourceeffortandisauseful,fullfeatured UMLtoolfreelyavailableundertheOpenPublicationLicense. GentlewarehastakenArgoUMLastepfurtherandturnedit intoagoodmodellingtool.Poseidoncomesindifferentflavors suitedtodifferentrequirements.Poseidonsupportsforward andreverseengineeringanddocumentationgenerationby usingspecialpurposeplugins. Gentlewarehasnotforgottenitsopensourcemooringsand offersthePoseidonforUMLCommunityEdition1.5freefor individualsoftwaredevelopers.

Pg 110 Integration of UML Tools with Integrated Development Environments (IDEs) OneinterestingfeatureinUMLtoolsthatwediscussedinthe previoussectionwasroundtripengineering.Forroundtrip engineeringtobeuseful,weneedtohavetheUMLtooltobeused inconjunctionwithanIDE.ThisintegrationofaUMLtoolwiththe IDEwillhelpyoutoreallybenefitfromroundtripengineering.Any changesintheapplicationcodethatyoumakeintheIDEare immediatelyreflectedinthemodelintheUMLtoolandviceversa. Forourdiscussion,wewillbeconsideringIDEsfortheJava language. QuiteafewoftheUMLtoolsonthemarketcanbeintegratedwith thepopularIDEssuchasIBM'sWebSphereStudio,Borland's JBuilder,WebGain'sVisualCafé,orSun'sForte.Forinstance, RationalRose(Javaedition)providesintegrationwithallofthese popularIDEs.TogetherControlCenterhasaspecialversionthat integrateswithIBM'sWebSphereStudio. ThedownsideofUMLtoolintegrationisthattheintegrationsolution isproprietarytotheUMLtoolvendor.Hence,youmightnotalways findaUMLtoolprovidingintegrationwithpopularIDEsinthe market.Butallthisischanging.(Seeboxfordetailsonthe project.) Eclipse Eclipseisanopensourceeffortthathastoolintegrationasthe longtermgoal.TheinterestingaspectofEclipseisthattheeffortis supportedbymajortoolvendors.Eclipseaimstodefineacrossthe boardintegrationstandardsthatwillenablevendorsofdifferent toolstoseamlesslyworktogetherandprovideacohesiveandsingle developmentenvironment.ThebeautyofEclipseisthatthe integrationbetweentoolsisnotaproprietarysolution.Inlayman's termsthismeansthat,forexample,youcanbuyanofftheshelf UMLtoolandintegrateitintoyourdevelopmentenvironment withouthavingtoworrythatyoumightbestuckwithaparticular vendororgroupofvendors.Eclipseisdefinitelyanareatowatch outforinthenearfuture!(www.eclipse.org)

Pg 111

WEEK Fourteen

CASE TOOL APPLICATION The Altova UModel (2008) UModel® 2008 Enterprise Edition isanaffordableUMLmodeling applicationwitharichvisualinterfaceandsuperiorusability featurestohelpleveltheUMLlearningcurve,andincludesmany highendfunctionstoempoweruserswiththemostpractical aspectsoftheUML2.1.2specification.UModelisa32bitWindows applicationthatrunsonWindows2000/2003,WindowsXPand WindowsVista. UModel 2008 supports: — all13UML2.1.2modelingdiagrams — VisualStudio.NETintegration(EnterpriseEditiononly) — Eclipseintegration(EnterpriseEditiononly) — XMLSchemadiagrams — BusinessProcessModelingNotation(EnterpriseEditiononly) — MultiplelayersperUMLdiagram(EnterpriseEditiononly) — importof Java,C#andVisualBasicbinaries — hyperlinkingofdiagramsandmodelingelements — syntaxcoloringindiagrams — cascadingstyles — unlimitedUndoandRedo sophisticatedJava,C#andVisualBasiccodegenerationfrom — models reverseengineeringofexistingJava,C#,andVisualBasicsource — code — completeroundtripprocessingallowingcodeandmodelmerging XMIversion2.1.1forUML2.0,2.1,&2.1.2modelimportand — export — generationofUModelprojectdocumentation Thesecapabilitiesallowdevelopers,includingthosenewtosoftware modeling,toquicklyleverageUMLtoenhanceproductivityand maximizetheirresults.

Pg 112 The UModel Interface UModelhasasimplifieddevelopmentinterfacethatpresenta beginnerinUMLwithawellstreamlinedwayforachievingresults.

Introducing UModel TheUMLisacompletemodelinglanguagebutdoesnotdiscuss,or prescribe,themethodologyforthedevelopment,codegeneration androundtripengineeringprocesses.UModelhasthereforebeen designedtoallowcompleteflexibilityduringthemodelingprocess: UModeldiagramscanbecreatedinanyorder,andatanytime; thereisnoneedtofollowaprescribedsequenceduring — modeling. Code,ormodelmergingcanbeachievedattheproject,package, orevenclasslevel.UModeldoesnotrequirethatpseudocode, orcommentsinthegeneratedcodebepresent,inorderto — accomplishroundtripengineering. Codegenerationiscustomizable:thecodegenerationinUModel — isbasedonSPLtemplatesandis,therefore,completely

Pg 113 customizable.Customizationsareautomaticallyrecognized duringcodegeneration. CodegenerationandreverseengineeringcurrentlysupportJava versions1.4.x,5.0and1.6,C#versions1.2,2.0and3.0,and VisualBasicversions7.1,8.0and9.0.Asingleprojectcan — supportJava,C#,orVBcodesimultaneously. — SupportforUMLtemplatesandgenerics. XMLMetadataInterchange(XMIversion2.1.1)forUML2.0/ — 2.1.1/2.1.2 Whenaddingproperties,oroperationsUModelprovidesinplace entryhelperstochoosetypes,protectionlevels,andallother mannerofpropertiesthatarealsoavailableinindustrialstrength — IDEssuchasXMLSpy,VisualStudio.NetorEclipse. SyntaxcoloringindiagramsmakesUMLdiagramsmore — attractiveandintuitive. Modelingelementsandtheirproperties(font,colors,borders etc.)arecompletelycustomizableinanhierarchicalfashionat — theproject,node/line,elementfamilyandelementlevel. Customizableactorscanbedefinedinusecasediagramsto — depictterminals,oranyothersymbols. ModelingelementscanbesearchedforbynameintheDiagram — tab,ModelTreepane,MessagesandDocumentationwindows. Class,orobjectassociations,dependencies,generalizationsetc. canbefound/highlightedinmodeldiagramsthroughthecontext — menu. TheunlimitedlevelsofUndo/Redotracknotonlycontent — changes,butalsoallstylechangesmadetoanymodelelement.

What'snewinUModel2008Release2 The2008Release2versionofUModelincludesthefollowingmajor andminorenhancements: — SupportforOMGBusinessProcessModelingNotation. — SupportforVisualBasic.NET9.0andC#3.0aswellasVisual

Pg 114 Studio.NET2008,Java1.6 — MultipleLayersperUModeldiagram — Mergingofprojectsisnowsupported — UserdefinedStereotypestylesandhowtodefinethem — EnhancedAutocompletioncapabilities — AutomaticgenerationofComponentRealizations — ImportingmultipleXMLSchemasfromadirectory Automaticgenerationofnamespacedirectoriesforgenerated — code — SupportforObjectNodesonActivitydiagrams — AbilitytogeneraterelativelinksforUMLdocumentation — UMLconformantvisibilityiconsinclassdiagrams — SupportforCollectionAssociations

What's new in UModel 2008 The2008versionofUModelincludesthefollowingmajorandminor enhancements: VisualBasiccodegenerationfrommodels,andreverse — engineeringofVisualBasiccode. — VisualStudio.NETintegration(EnterpriseEditiononly). — Eclipseintegration(EnterpriseEditiononly). — Abiltytosaveallprojectdiagramsasimagesinonego. Multilinelifelinetitlesinsequence,communicationandtiming — diagrams. SupportforeventsubelementsinStateMachineDiagrams: — ReceiveSignalEvent,SignalEvent,SendSignalEvent,

Pg 115 ReceiveOperationEvent,SendOperationEventandChangeEvent. New'gotooperation'optionforcallmessagesonSequenceand — CommunicationDiagrams. — Signalscannowhavegeneralizationsandownattributes. — Enhancedtaggedvaluesupport — AbilitytoFind&Replacemodelingelements. Sequencediagrams: Automaticgenerationof(syntacticallycorrect)replieswhen — addingmessagestosequencediagrams. — StaticoperationnamesareunderlinedinSequencediagrams. Ehanced"Override/ImplementOperations"dialog. Operationsfromboundtemplatescanbemadevisibleandalso — beoverridden — Showwhichoperationsareabstractorundefined

Pg 116