Vous êtes sur la page 1sur 44

LabManual

ObjectOrientedAnalysisAndDesign

TE(Computer) VIsemester

Index
Sr.No.
1 2 3 4 5 6 7 8 9 10

TitleofProgrammingAssignment
StudyofUseCaseDiagram StudyofActivityDiagram StudyofClassDiagram Studyopackagediagram StudyofSequenceDiagram StudyofCollaborationDiagram StudyofStatechartDiagram StudyofComponentDiagram StudyofDeploymentDiagram StudyUseCaseRealization

PageNo. 3 9 13 19 22 25 28 33 36 42

1
StudyofUseCaseDiagram

1. OBJECTIVE
StudytheBenefitsifusecasemodeling Learnusecasediagram:Discoveringactorsanddiscoveringusecases. PracticeusecasesdiagramsusingRationalRose.

2. REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE:
KnowledgeofRequirementsDocument

4. THEORY 4.1UseCaseDiagram
TheUsecasediagramisusedtoidentifytheprimaryelementsandprocessesthatform thesystem.Theprimaryelementsaretermedas"actors"andtheprocessesarecalled"use cases."TheUsecasediagramshowswhichactorsinteractwitheachusecase Ausecasediagramcapturesthefunctionalaspectsofasystem.Morespecifically,itcap turesthebusinessprocessescarriedoutinthesystem.Asyoudiscussthefunctionality 4

andprocessesofthesystem,youdiscoversignificantcharacteristicsofthesystemthat youmodelintheusecasediagram.Duetothesimplicityofusecasediagrams,andmore importantly,becausetheyareshortofalltechnicaljargon,usecasediagramsareagreat storyboardtoolforusermeetings.Usecasediagramshaveanotherimportantuse.Use casediagramsdefinetherequirementsofthesystembeingmodeledandhenceareusedto writetestscriptsforthemodeledsystem. Sowhoshouldnormallybeinvolvedinthecreationofusecases?Normally,domain expertsandbusinessanalystsshouldbeinvolvedinwritingusecasesforagivensystem. Usecasesarecreatedwhentherequirementsofasystemneedtobecaptured.Because,at thispointnodesignordevelopmentactivitiesareinvolved,technicalexpertsshouldnot beapartoftheteamresponsibleforcreatingusecases.Theirexpertisecomesinuselater inthesoftwarelifecycle.

4.2ElementsOfAUseCaseDiagram

Actors AreNOTpartofthesystemtheyrepresentanyoneoranythingthatmust Interactwiththesystem. Onlyinputinformationtothesystem. Onlyreceiveinformationfromthesystem. Bothinputtoandreceiveinformationfromthesystem. RepresentedinUMLasastickman

UseCase

Asequenceoftransactionsperformedbyasystemthatyieldsa measurableresultofvaluesforaparticularactor Ausecasetypicallyrepresentsamajorpieceoffunctionality thatiscompletefrombeginningtoend.Ausecasemust deliversomethingofvaluetoanactor.

UseCaseRelationships Betweenactorandusecase. Association/Communication. Arrowcanbeineitherorbothdirections;arrowindicateswhoinitiatescommuni cation.

(a)Betweenusecases(generalization): Uses Wheremultipleusecasessharepiecesofsamefunctionality. Extends Optionalbehavior. Behavioronlyrunsundercertainconditions(suchasalarm). Severaldifferentflowsrunbasedontheusersselection.

4.3USECASESPECIFICATIONS

Name Identifier Description Goal Actors IncludedUse Cases ExtendedUse Case Preconditions Postconditions Assumptions Frequency FlowOfEvent

Nameofusecase Auniqueidentifierforthisusecase,e.g.UC10 Acoupleofsentencesoraparagraphdescribingthebasicideaof theusecase Thebusinessgoaloftheinitiatingactor Listofactorsthatparticipateintheusecase Optional,Listofusecasesthatthisusecaseincludes Optional,Theusecase,ifany,thatthisusecaseextends Listthestate(s)thesystemcanbeinbeforethisusecasestarts Listthestate(s)thesystemcanbeinwhenthisusecaseends Optional,Listallassumptionsthathavebeenmade Approximatelyhowoftenthisusecaseisrealized,e.g.,oncea week,500timesaday,etc Basic Flow thenormalprocessingpath,aka,theHappyPath

Alternative DescriptionofthealternatecourseCondition Flow

5 EXERCISES
1.Takeallusecasesfromexperimentsno.2anddrawactivitydiagramforthatusing Rationalrose.

6 SAMPLEOUTPUT
Usecasediagramofthegivenproblem 7

7 DELIVERABLE
Studentshouldsubmitthesolutionsforthepreviousexercises. StudentshoulddrawusecasediagramsforgivenprojectusingRationalRose. StudentshouldcreateUsecasespecifications.

2
StudyofActivityDiagram

1. OBJECTIVE
DeeperunderstandingofUMLactivitydiagrams. PracticingactivitydiagramsusingRationalRose. Inthislab,wewillcoverthedynamicdiagramtheActivitydiagram.Bytheend ofthisarticle,youwillknowwhatanActivitydiagramis,whatitselementsare, andyouwillbeabletocreateActivitydiagramsforyoursystem.

2. REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
UseCaseDiagram

4. THEORY

TheeasiestwaytovisualizeanActivitydiagramistothinkofaflowchartofacode.The flowchartisusedtodepictthebusinesslogicflowandtheeventsthatcausedecisionsand actionsinthecodetotakeplace. Activitydiagramsrepresentthebusinessandoperationalworkflowsofasystem.AnAc tivitydiagramisadynamicdiagramthatshowstheactivityandtheeventthatcausesthe objecttobeintheparticularstate.

10

ElementsofanActivitydiagram
AnActivitydiagramconsistsofthefollowingbehavioralelements:

Elementanditsdescription InitialActivity:Thisshowsthestartingpointorfirstactivityofthe flow.Denotedbyasolidcircle.Thisissimilartothenotationused forInitialState. Activity:Representedbyarectanglewithrounded(almostoval) edges. Decisions:Similartoflowcharts,alogicwhereadecisionistobe madeisdepictedbyadiamond,withtheoptionswrittenoneither sidesofthearrowsemergingfromthediamond,withinboxbrackets.

Symbol

Signal:Whenanactivitysendsorreceivesamessage,thatactivityis calledasignal.Signalsareoftwotypes:Inputsignal(Message receivingactivity)shownbyaconcavepolygonandOutputsignal (Messagesendingactivity)shownbyaconvexpolygon.

ConcurrentActivities:Someactivitiesoccursimultaneouslyorin parallel.Suchactivitiesarecalledconcurrentactivities.Forexample, listeningtothelecturerandlookingattheblackboardisaparallel activity.Thisisrepresentedbyahorizontalsplit(thickdarkline)and thetwoconcurrentactivitiesnexttoeachother,andthehorizontal lineagaintoshowtheendoftheparallelactivity.

FinalActivity:TheendoftheActivitydiagramisshownbyabull's eyesymbol,alsocalledasafinalactivity.

5. EXERCISES
1.Takeallusecasesfromexperimentsno.2anddrawactivitydiagramforthatusing Rationalrose. 11

6. SAMPLEOUTPUT
Usecasediagramofthegivenproblem

7. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. Activitydiagramsforallusecases

12

3
StudyofClassDiagram

13

1. OBJECTIVE
Inthislab,wewillseewhatclassdiagramsare,whattheelementsofaclassdiagramare, whateachoftheseelementssignify,andhowtoidentifythem. Afterthislabstudentswillbeabletodefineclassesforasystemandreadandcreateclass diagrams.

2.REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3.PREREQUISITE
UseCaseDiagram

4 THEORY
Aclassdiagramconsistsofagroupofclassesandinterfacesreflectingimportantentities ofthebusinessdomainofthesystembeingmodeled,andtherelationshipsbetweenthese classesandinterfaces.Theclassesandinterfacesinthediagramrepresentthemembersof afamilytreeandtherelationshipsbetweentheclassesareanalogoustorelationshipsbe tweenmembersinafamilytree.Interestingly,classesinaclassdiagramareinterconnect edinahierarchicalfashion,likeasetofparentclassesandrelatedchildclassesunderthe parentclasses. Aclassdiagramisadiagramshowingacollectionofclassesandinterfaces,alongwith thecollaborationsandrelationshipsamongclassesandinterfaces. Aclassdiagramisapictorialrepresentationofthedetailedsystemdesign.Designexperts whounderstandtherulesofmodelinganddesigningsystemsdesignthesystem'sclassdi agrams.Athingtorememberisthataclassdiagramisastaticviewofasystem.The

14

structureofasystemisrepresentedusingclassdiagrams.Classdiagramsarereferenced timeandagainbythedeveloperswhileimplementingthesystem.

4.1ClassesCategories
Classesaredividedintothreecategories Entity Modelsinformationandassociatedbehaviorthatislonglived,independent ofthesurrounding,applicationindependent,andaccomplishessomeresponsibility Boundary Handlesthecommunicationbetweenthesystemsurroundingsandthe insideofthesystem,providesinterface,andfacilitatescommunicationwithother systems Control Modelsequencingbehaviorspecifictooneormoreusecases.Control classescoordinatetheeventsneededtorealizethebehaviorspecifiedintheuse case,andtheyareresponsiblefortheflowofeventsintheusecase.

4.2ElementsofaClassDiagram
Class:Aclassrepresentsanentityofagivensystemthatprovidesanencapsulatedimple mentationofcertainfunctionalityofagivenentity.Theseareexposedbytheclasstooth erclassesasmethods.Apartfrombusinessfunctionality,aclassalsohaspropertiesthat reflectuniquefeaturesofaclass.Thepropertiesofaclassarecalledattributes. Aclassisrepresentedbyarectangle.Thefollowingdiagramshowsatypicalclassina classdiagram:

15

RelationshipsBetweenClasses
relationships between classes, their notation, and what they mean. Sr. Relation No. 1 Association Symbol Description When two classes are connected to each other in any way, an association relation is established. For example: A "student studies in a college" association can be shown as: An example of this kind of association is many students belonging to the same college. Hence, the relation shows a star sign near the student class (one to many, many to many, and so forth kind of relations). Association between classes is bi-directional by default. You can define the flow of the association by using a directed association. The arrowhead identifies the containercontained relationship. No separate symbol. However, the relation will point back at the same class. An example of this kind of relation is when a class has a variety of responsibilities. For example, an employee of a college can be a professor, a housekeeper, or an administrative assistant. When a class is formed as a collection of other classes, it is called an aggregation relationship

1 a. Multiplicity

1 b. Directed Association

1 c. Reflexive Association

Aggregation

16

between these classes. It is also called a "has a" relationship. 2 a. Composition Composition is a variation of the aggregation relationship. Composition connotes that a strong life cycle is associated between the classes. Also called an "is a" relationship, because the child classis a type of the parent class. Generalization is the basic type of relationship used to define reusable elements in the class diagram. Literally, the child classes "inherit" the common functionality defined in the parent class. In a realization relationship, one entity (normally an interface) defines a set of functionalities as a contract and the other entity (normally a class) "realizes" the contract by implementing the functionality defined in the contract.

Inheritance/Generalization

Realization

4.3AFewTerms
Here are a few terms that we will be using to annotate our class diagrams. You should be familiar with them:

Responsibility of a class: It is the statement defining what the class is expected to provide. Stereotypes: It is an extension of the existing UML elements; it allows you to define new elements modeled on the existing UML elements. Only one stereotype per element in a system is allowed.

17

Vocabulary: The scope of a system is defined as its vocabulary. Analysis class: It is a kind of a stereotype. Boundary class: This is the first type of an analysis class. In a system consisting of a boundary class, the users interact with the system through the boundary classes. Control class: This is the second type of an analysis class. A control class typically does not perform any business functions, but only redirects to the appropriate business function class depending on the function requested by the boundary class or the user. Entity class: This is the third type of an analysis class. An entity class consists of all the business logic and interactions with databases.

5. EXERCISE
Drawaclassdiagramoftheproblemgiveninlab1

6. SAMPLEOUTPUT
Classdiagramofagivensystem

7. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. Alsostudentshouldusetheseclasselicitationtechniquestoidentifytheclasses forproject.

18

4
StudyofPackageDiagram

19

1. OBJECTIVE
Inthislab,wewillseewhatpackagediagramis,whattheelementsofapackagediagram are,whateachoftheseelementssignify. Afterthislabstudentswillbeabletocreatepackagediagram.

2. REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram

4. THEORY
Packagediagramsareusedtoreflecttheorganizationofpackagesandtheirelements. Whenusedtorepresentclasselements,packagediagramsprovideavisualizationofthe namespaces.Themostcommonuseforpackagediagramsistoorganizeusecasedia gramsandclassdiagrams,althoughtheuseofpackagediagramsisnotlimitedtothese UMLelements.

4.1ElementsofanPackagediagram
Package Packagesaregeneralpurposegroupingmechanisms.Apackageispurelyconceptual.A packageprovidestheabilitytogrouptogetherclasses,interfaces,components,nodes, collaborations,usecasesandevenotherpackageswhichareeithersimilarinnatureorre

20

lated.Groupingthesedesignelementsinapackageelementprovidesbetterreadabilityof classdiagrams,especiallycomplexclassdiagrams. Packageshaveanamethatuniquelyidentifiesthepackage.Apackageisrepresentedasa tabbedfolder,usuallyincludingonlyitsnameand,sometimes,itscontents

Relationship

5. EXERCISE
Drawapackagediagramoftheproblemgiveninlab1

6. SAMPLEOUTPUT
Packagediagramofgivenproject.

7. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. Alsostudentshoulddrawpackagediagram.

21

StudyOfSequenceDiagram

22

1. OBJECTIVE
Inthislab,wewillseewhatSequencediagramis,whattheelementsofaSequencedia gramare,whateachoftheseelementssignify.Bytheendofthislab,studentwillknow whataSequencediagramis,whatitselementsare,and,studentwillbeabletocreateSe quencediagramsforyoursystem.

2. REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram ActivityDiagram

4. THEORY
ASequencediagramdepictsthesequenceofactionsthatoccurinasystem.Theinvoca tionofmethodsineachobject,andtheorderinwhichtheinvocationoccursiscaptured inaSequencediagram.ThismakestheSequencediagramaveryusefultooltoeasilyrep resentthedynamicbehaviorofasystem. ASequencediagramistwodimensionalinnature.Onthehorizontalaxis,itshowsthe lifeoftheobjectthatitrepresents,whileontheverticalaxis,itshowsthesequenceofthe creationorinvocationoftheseobjects. Becauseitusesclassnameandobjectnamereferences,theSequencediagramisvery usefulinelaboratinganddetailingthedynamicdesignandthesequenceandoriginofin

23

vocationofobjects.Hence,theSequencediagramisoneofthemostwidelyuseddynam icdiagramsinUML.

ElementsofaSequencediagram
ASequencediagramconsistsofthefollowingbehavioralelements:

S.No. Elementanditsdescription

Symbol

Object:Theprimaryelementinvolvedinasequencediagramis anObjectaninstanceofaclass.ASequencediagramconsists ofsequencesofinteractionamongdifferentobjectsoveraperiod oftime.Anobjectisrepresentedbyanamedrectangle.The nametotheleftofthe":"istheobjectnameandtoitsrightisthe classname. Message:Theinteractionbetweendifferentobjectsina sequencediagramisrepresentedasmessages.Amessageis denotedbyadirectedarrow.Dependingonthetypeofmessage, thenotationdiffers.InaSequencediagram,youcanrepresent simplemessages,specialmessagestocreateordestroyobjects, andmessageresponses.

5. EXERCISE
DrawaSequencediagramoftheproblemgiveninlab1

6. SAMPLEOUTPUT
Sequencediagramofgivenproject.

7. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. AlsostudentshoulddrawSequencediagram.

24

6
StudyOfCollaborationDiagram

25

1. OBJECTIVE
Inthislab,wewillseewhatCollaborationdiagramis,whattheelementsofaCollabora tiondiagramare,whateachoftheseelementssignify.Bytheendofthislab,studentwill knowwhataCollaborationdiagramis,whatitselementsare,and,studentwillbeableto createCollaborationdiagramsforgivensystem.

3. REFERENCES
www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram ActivityDiagram

4. THEORY
ACollaborationdiagramisverysimilartoaSequencediagraminthepurposeit achieves;inotherwords,itshowsthedynamicinteractionoftheobjectsinasystem.A distinguishingfeatureofaCollaborationdiagramisthatitshowstheobjectsandtheiras sociationwithotherobjectsinthesystemapartfromhowtheyinteractwitheachother. TheassociationbetweenobjectsisnotrepresentedinaSequencediagram. ACollaborationdiagramiseasilyrepresentedbymodelingobjectsinasystemandrepre sentingtheassociationsbetweentheobjectsaslinks.Theinteractionbetweentheobjects isdenotedbyarrows.Toidentifythesequenceofinvocationoftheseobjects,anumberis placednexttoeachofthesearrows. 26

Asophisticatedmodelingtoolcaneasilyconvertacollaborationdiagramintoasequence diagramandtheviceversa.Hence,theelementsofaCollaborationdiagramareessential lythesameasthatofaSequencediagram.

4.1 ElementsofaCollaborationdiagram
ACollaborationdiagramconsistsofthefollowingelements:
S. No. Element and its description Symbol

1 2 3

Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined. Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality. Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.

5. EXERCISE:
DrawaStateChartdiagramoftheproblemgiveninlab1

6. SAMPLEOUTPUT
CollaborationDiagramofgivenproject.

7. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. AlsostudentshoulddrawCollaborationdiagram.

27

StudyOfStateChartDiagram

28

1. OBJECTIVE
Bytheendofthislab,studentwillknowwhataStatediagramis,whatitselementsare, andstudentswillbeabletocreateStatediagramsforthesystem.

2. REFERENCES

www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram ActivityDiagram

4. THEORY
Statediagrams(alsocalledStateChartdiagrams)areusedtohelpthedeveloperbetter understandanycomplex/unusualfunctionalitiesorbusinessflowsofspecializedareasof thesystem.Inshort,Statediagramsdepictthedynamicbehavioroftheentiresystem,or asubsystem,orevenasingleobjectinasystem.ThisisdonewiththehelpofBehav ioralelements.

4.1ElementsofaStatediagram
AStatediagramconsistsofthefollowingbehavioralelements:

29

S.No.

ElementanditsDescription

Symbol

30

InitialState:Thisshowsthestartingpointorfirstactivityoftheflow. Denotedbyasolidcircle.Thisisalsocalledasa"pseudostate," wherethestatehasnovariablesdescribingitfurtherandnoactivities. State:Representsthestateofobjectataninstantoftime.Inastate diagram,therewillbemultipleofsuchsymbols,oneforeachstateof theObjectwearediscussing.Denotedbyarectanglewithrounded cornersandcompartments(suchasaclasswithroundedcornersto denoteanObject).Wewilldescribethissymbolindetailalittlelater. Transition:AnarrowindicatingtheObjecttotransitionfromone statetotheother.Theactualtriggereventandactioncausingthe transitionarewrittenbesidethearrow,separatedbyaslash. Transitionsthatoccurbecausethestatecompletedanactivityare called"triggerless"transitions.Ifaneventhastooccurafterthe completionofsomeeventoraction,theeventoractioniscalledthe guardcondition.Thetransitiontakesplaceaftertheguardcondition occurs.Thisguardcondition/event/actionisdepictedbysquare bracketsaroundthedescriptionoftheevent/action(inotherwords,in theformofaBooleanexpression). HistoryStates:Aflowmayrequirethattheobjectgointoatrance,or waitstate,andontheoccurrenceofacertainevent,gobacktothe stateitwasinwhenitwentintoawaitstateitslastactivestate.This isshowninaStatediagramwiththehelpofaletterHenclosedwithin acircle. EventandAction:Atriggerthatcausesatransitiontooccuriscalled asaneventoraction.Everytransitionneednotoccurduetothe occurrenceofaneventoractiondirectlyrelatedtothestatethat transitionedfromonestatetoanother.Asdescribedabove,an event/actioniswrittenaboveatransitionthatitcauses. Signal:Whenaneventcausesamessage/triggertobesenttoastate, thatcausesthetransition;then,thatmessagesentbytheeventiscalled asignal.Representedasaclasswiththe<<Signal>>iconabovethe action/event.

FinalState:Theendofthestatediagramisshownbyabull'seye symbol,alsocalledafinalstate.Afinalstateisanotherexampleofa pseudostatebecauseitdoesnothaveanyvariableoractiondescribed.

5. EXERCISE:
31

DrawaStateChartdiagramoftheproblemgiveninlab1

6. SAMPLEOUTPUT
StateDiagramofgivenproject.

7. Deliverables
Studentshouldsubmitthesolutionsforthepreviousexercises. AlsostudentshoulddrawStatediagram.

32

StudyOfComponentDiagram

33

1. OBJECTIVE
In this lab, we will see what Component diagram is, what the elements of a Componentdiagramare,whateachoftheseelementssignify.Bytheendofthis lab,studentwillknowwhataComponentdiagramis,whatitselementsare,and, studentwillbeabletocreateComponentdiagramsforgivensystem.

2.REFERENCES

www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram ActivityDiagram

4. THEORY
ThedifferenthighlevelreusablepartsofasystemarerepresentedinaComponentdia gram.Acomponentisonesuchconstituentpartofasystem.Inadditiontorepresenting thehighlevelparts,theComponentdiagramalsocapturestheinterrelationshipsbetween theseparts. So,howarecomponentdiagramsdifferentfromthepreviousUMLdiagramsthatwe haveseen?TheprimarydifferenceisthatComponentdiagramsrepresenttheimplemen tationperspectiveofasystem.Hence,componentsinaComponentdiagramreflect groupingofthedifferentdesignelementsofasystem,forexample,classesofthesystem. Letusbrieflyunderstandwhatcriteriatoapplytomodelacomponent.Firstandfore most,acomponentshouldbesubstitutableasis.Secondly,acomponentmustprovidean interfacetoenableothercomponentstointeractandusetheservicesprovidedbythe

34

component.So,whywouldnotadesignelementlikeaninterfacesuffice?Aninterface providesonlytheservicebutnottheimplementation.Implementationisnormallyprovid edbyaclassthatimplementstheinterface.Incomplexsystems,thephysicalimplemen tationofadefinedserviceisprovidedbyagroupofclassesratherthanasingleclass.A componentisaneasywaytorepresentthegroupingtogetherofsuchimplementation classes. Youcanmodeldifferenttypesofcomponentsbasedontheiruseandapplicabilityina system.Componentsthatyoucanmodelinasystemcanbesimpleexecutablecompo nentsorlibrarycomponentsthatrepresentsystemandapplicationlibrariesusedinasys tem.Youalsocanhavefilecomponentsthatrepresentthesourcecodefilesofanapplica tionordocumentfilesthatrepresent,forexample,theuserinterfacefilessuchasHTML orJSPfiles.Finally,youcanusecomponentstorepresenteventhedatabasetablesofa systemaswell!

Elements of a Component Diagram


A Component diagram consists of the following elements: S. NO. Element and its description Symbol

Component: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined. Class/Interface/Object: Similar to the notations used in class and object diagrams Relation/Association: Similar to the relation/association used in class diagrams

2 3

5. EXERCISE
DrawaComponentdiagramoftheproblemgiveninlab1

6. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. Alsostudentshoulddrawcomponentdiagram.

35

StudyOfDeploymentDiagram

36

1. OBJECTIVE
Inthislab,wewillseewhatDeploymentdiagramis,whattheelementsofadeployment diagramare,whateachoftheseelementssignify.Bytheendofthislab,studentwill knowwhatadeploymentdiagramis,whatitselementsare,and,studentwillbeableto createdeploymentdiagramsforgivensystem.

2. REFERENCES

www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram ActivityDiagram

4. THEORY
Adeploymentdiagrammodelstheruntimearchitectureofasystem.Itshowstheconfig urationofthehardwareelements(nodes)andshowshowsoftwareelementsandartifacts aremappedontothosenodes. AUML2deploymentdiagramdepictsastaticviewoftheruntimeconfigurationofpro cessingnodesandthecomponentsthatrunonthosenodes.Inotherwords,deployment diagramsshowthehardwareforyoursystem,thesoftwarethatisinstalledonthathard ware,andthemiddlewareusedtoconnectthedisparatemachinestooneanother.You wanttocreateadeploymentdiagramforapplicationsthataredeployedtoseveralma chines,forexampleapointofsalesapplicationrunningonathinclientnetworkcomput erwhichinteractswithseveralinternalserversbehindyourcorporatefirewalloracus tomerservicesystemdeployedusingawebservicesarchitecturesuchasMicrosofts 37

.NET.Deploymentdiagramscanalsobecreatedtoexplorethearchitectureofembed ded systems,showinghow thehardwareandsoftwarecomponents worktogether. In short,youmaywanttoconsidercreatingadeploymentdiagramforallbutthemosttriv ialofsystems.

ElementsofaComponentDiagram
AComponentdiagramconsistsofthefollowingelements: Node ANodeiseitherahardwareorsoftwareelement.Itisshownasathreedimensionalbox shape,asshownbelow.

NodeInstance Anodeinstancecanbeshownonadiagram.Aninstancecanbedistinguishedfroma nodebythefactthatitsnameisunderlinedandhasacolonbeforeitsbasenodetype.An instancemayormaynothaveanamebeforethecolon.Thefollowingdiagramshowsa namedinstanceofacomputer.

NodeStereotypes Anumberofstandardstereotypesareprovidedfornodes,namelycdrom,cdrom, computer,diskarray,pc,pcclient,pcserver,secure,server,storage,

38

unixserver,userpc.Thesewilldisplayanappropriateiconinthetoprightcornerof thenodesymbol

Artifact Anartifactisaproductofthesoftwaredevelopmentprocess.Thatmayincludeprocess models(e.g.usecasemodels,designmodelsetc),sourcefiles,executables,designdocu ments,testreports,prototypes,usermanuals,etc. Anartifactisdenotedbyarectangleshowingtheartifactname,theartifactkeyword andadocumenticon,asshownbelow.

Association Inthecontextofadeploymentdiagram,anassociationrepresentsacommunicationpath betweennodes.Thefollowingdiagramshowsadeploymentdiagramforanetwork,de pictingnetworkprotocolsasstereotypes,andmultiplicitiesattheassociationends.

39

NodeasContainer Anodecancontainotherelements,suchascomponentsorartifacts.Thefollowingdia gramshowsadeploymentdiagramforpartofanembeddedsystem,depictinganexe cutableartifactasbeingcontainedbythemotherboardnode.

40

5. EXERCISE
DrawaDeploymentdiagramoftheproblemgiveninlab1

6. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. AlsostudentshoulddrawDeploymentdiagram.

41

10

StudyOfUsecaserealization

42

1. OBJECTIVE
Inthislab,studentwillgetanideaaboutUsecaserealization.

2. REFERENCES

www.developer.com TheUnifiedModelingLanguageUserGuidebyGradyBooch MasteringUMLwithRationalRosebyWendyBoggs FundamentalsofRationalRoseStudentManualversion2002.05.00

3. PREREQUISITE
ClassDiagram UseCaseDiagram Usecasespecification Sequencediagram Communicationdiagram

4.THEORY
A usecase realization is the realization of the functionality of all use cases in system.Theusecaserealizationisimplementedbycollaborationoftheusecases attachedtoitbydependencies. Whenthecollaborationisblowupweget2parts A.) Classdiagramimplementingthescenario. B.) CollaborationorSequencediagram Use case realization is the implementation of all business functionality for the scenariounderconsideration

43

UseCase

U UseCaserealization

2. EXERCISE
ShowUsecaserealization

3. DELIVERABLES
Studentshouldsubmitthesolutionsforthepreviousexercises. AlsostudentunderstandsUseCaserealization.

44