Iformatio Systems Cocepts Requiremets Aalysis Roma Kotchakov Birkbeck, Uiversity of Lodo Based o Chapter 7 of Beett, McRobb ad Farmer: Object Orieted Systems Aalysis ad Desig Usig UML, (4th Editio), McGraw Hill, 2010 1
Outlie Class Diagrams Sectio 7.3 (pp. 184 194) Sectio 7.5.5 7.5.10 (pp. 208 215) Sectio 7.5.2 (pp. 198 201) 2
Class Diagrams Class (ad Object/Istace) Stereotypes Attributes (ad State) Associatios (ad Liks) Multiplicity Operatios Symbols of Istaces, States, ad Liks are used i other UML diagram types (Object Diagrams, Commuicatio Diagrams, etc.) 3
Notatio: Class class ame compartmet attributes compartmet operatios compartmet Cliet compayaddress compayemail compayfax compayname compaytelephoe 4
Notatio: Object/Istace object ame compartmet attribute values FoodCo:Cliet compayaddress=evas Farm, Norfolk compayemail=mail@foodco.com compayfax=01589-008636 compayname=foodco compaytelephoe=01589-008638 istaces do ot have operatios 5
Attributes Attributes are: part of the essetial descriptio of a class the commo structure of what all objects of the class ca kow each object has its ow value for each attribute of its class attribute values characterize state of the object 6
Notatio: Attributes Campaig actualcost campaigfiishdate campaigstartdate completiodate datepaid estimatedcost title checkcampaigbudget ( ) getcampaigcotributio ( ) recordpaymet ( ) setcompleted ( ) 7
Liks Yellow Partridge:Cliet a lik is a logical coectio betwee two objects FoodCo:Cliet Grace Chia:StaffMember Soog Motor Co:Cliet Carlos Mocada:StaffMember 8
Associatios A associatios represet the possibility of a logical relatioship or coectio betwee objects of oe class ad objects of aother If two objects ca be liked, their classes have a associatio 9
Notatio: Associatios associatio associatio role StaffMember staffcotact staffname staffno liaises with staffstartdate Cliet compayaddress compayemail compayfax compayname compaytelephoe associatio ame directio i which ame should be read 10
Notatio: Associatios StaffGrade gradestartdate gradefiishdate previous associatio role followig
Multiplicity The multiplicity of a associatio is the rage of permitted cardialities of its participatig objects, accordig to or busiess rules. for example: ay bak customer may have oe or more accouts every idividual accout is for oe, ad oly oe, customer 12
Notatio: Multiplicity : exactly *: ay umber m..: ay umber i the rage m to (iclusive) 0..1: optioal (i.e., either oe or 1) 1..*: at least oe 13
Notatio: Multiplicity StaffMember staffname staffno staffstartdate multiplicities 1 0..* liaises with Cliet compayaddress compayemail compayfax compayname compaytelephoe A staff member may liaise with ay umber of cliets (icludig 0) Each cliet is liaised with exactly oe staff member See Also: Figure 7.9-7.11 (p. 191) 14
Operatios Operatios are: part of the essetial descriptio of a class the commo behaviour that all objects of the class ca do get or set attribute values (ot specified i Aalysis Model) perform calculatios sed messages to other objects create or destroy liks (ot specified i Aalysis Model) services that objects of a class ca provide to other objects 15
Notatio: Operatios Campaig actualcost campaigfiishdate campaigstartdate completiodate datepaid estimatedcost title checkcampaigbudget ( ) getcampaigcotributio ( ) recordpaymet ( ) setcompleted ( ) 16
Static Aalysis with UML Requiremets Model Aalysis Model Desig Model To Draw a Aalysis Class Diagram Idetify Classes Determie Stereotypes Fid ad Locate Attributes Add Associatios Determie Multiplicity Fid ad Locate Operatios 17
Lookig for Potetial Classes Category People Orgaisatios Structures Physical thigs Abstractios of people Abstractios of physical thigs Coceptual thigs Edurig relatioships betwee members of other categories. Examples Mr Harmsworth (a campaig maager), Dilip (a copywriter). Joes & Co (a forklift truck distributor), the Soog Motor Compay, Agate s Creative Departmet. Team, project, campaig, assembly. Fork-lift truck, electric drill, tube of toothpaste. Employee, supervisor, customer, cliet. Wheeled vehicle, had tool, retail goods. Campaig, employee, rule, team, project, customer, qualificatio. Sale, purchase, cotract, campaig, agreemet, assembly, employmet. 18
Idetifyig Classes Should this really be cosidered as a class? Is it beyod the scope of the system? Does it refer to the system as a whole? Does it duplicate aother class? Is it too vague? Is it too specific? Is it too tied up with physical iputs ad outputs? Is it really a attribute? Is it really a operatio? Is it really a associatio? If ay aswer is Yes, cosider modellig the potetial class i some other way (or do ot model it at all). 19
Take Home Messages Class Diagrams Class (ad Object/Istace) Attributes (ad State) Associatios (ad Liks) Multiplicity Operatios 20