Home

UML Class Diagrams with Magicdraw

image

Contents

1. e i s O xl Look and Feel P E E Data Business Analyst E T Dalakhinne Interface Style E ei Setting the scene l 7 Expert Th nari me AEEA states Leave Expert check box not selefi Change to Software Architect once the client actually sees the chil eels Wllllee Stee adel person usually the person they have the Description E CECEK App appointment with a visit is recorded The Perspective is set of roles primagfy involved in designing and implementing visit can be with anyone discussed project Software Architect DgSigner Interface designer Database above a visit may be with more than one designer This is default Magiftraw configuration All functionalities are available For expert mode person such as a GP and a trainee GP bh For the time being we will ignore the multiplicity details for each of the associations described above More _Concel_ hep importantly we have a situation of a client seeing anyone discussed above which is rather problematic To model this have created a new superclass called carer you may argue that some employees may not be Carers but will ignore this for the moment The only other new class that needs to be added is Visit Exercise 7 Edit your diagram to look like the one below where I have 1 Added a CARER class and created another generalisation set called employee type making it complete disjoint 2 Added a VISIT class poc employee O p Sl co
2. You then add the required classes to al the diagram and then draw the required cancel p Composition association line as show below Image Shape 1 select the Composition option 2 Drag from the Assembly collection class to the component class from Pee to Employee Separator l Class Diagram Exercise 2 H Class f 3 Adjust the line to look pleasing Create the diagram opposite you 7 Imtsrface will need to move the various lines E Facas i carefully to make them look as neat Generalization hi as this a Bssociation i A ggregation T Also check the Youtube video E ostin i Drawing UML aggregation and gt iterace Reai composition associations at Ei i lJ http www youtube com playlist list La Abstraction i an 7 A PL5D590974B7967000 a ee Cai cer at robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class_2007 doc Page 4 of 12 UML Class diagrams with MagicDraw 4 Recursion A good example in the above scenario of where recursion could be modelled in UML is the sentence The voluntary workers are managed by a voluntary worker co coordinator who is also herself a voluntary worker The edited screen shot below provides details of how to achieve this in Magicdraw Anchor ki 1 Select Association Containment 2 Click twice on V_Worker to create the start and end of the line A Dependency F 3 Left mous
3. End of document Tuesday 04 October 2011 robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class 2007 doc Page 12 of 12
4. Se Customize E Cut i Tags Generalization Set i Constraints Narme patient_type fo Delete OWINEF Data Applied Stereotype Create Symbol Generalization registered Client patien Generalization Generalization holiday Client patient_t Powerly pe Is Disjoint M true Is Covering False ose rarnana Exercise 6 Have a look at the containment panel robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class_2007 doc Page 9 of 12 UML Class diagrams with MagicDraw 7 Ternary associations The Chapter An introduction to UML part 2 Associations explains Ternary associations and also information can be found in MagicDraw in help under N ary Association Unfortunately the diamond symbol you require to draw this type of association only appears on the menu after you have changed the perspective to software architect You may remember that when you initially installed Magicdraw you set it to the System Analyst perspective p7 MagicDraw UML Personal Edition 12 1 PCC scenario mdzip C uml pcc_scenario PCC To set the MagicDraw perspective to File Edit View Layout Diagrams Tools Analyze Window Help Software Architect select the menu DEHRA Se Pae cC scenario mdzip ig Option Options gt perspectives gt ae perspectives then _ follow the va Conta k Inherit ig Diag ES overview instructions Environment TT Containment h l a
5. Image Shape Separator l Class Diagram ii Class Interface P Package A Generalization Association a Aggregation 4 Composition aP Interface Reali ait Usage Exercise 4 Create the two subtypes described above Remember you will need to move the various lines and classes carefully to make them look neat robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class 2007 doc Page 6 of 12 UML Class diagrams with MagicDraw 6 Generalisation sets The Chapter An introduction to UML part 2 Associations explains what generalisation sets are We will create a generalisation set for the two subtypes we have just formed and give it the name patient_type This involves rather a complex set of dialogue boxes good luck BE cee euch ieri e mera aap Fi tne ag J Common overview 4 Mote 1 Select one of the generalisation lines right mouse click to bring up the c Text Box popup menu select Specification or click enter Anch 2 In the generalization dialogue box click on the Generalisation set option p ent then the button appears on the far right click on it to bring up the next 1 Dependency dialogue box J Image Shape Separator s Class Diagram g Class hi 2 Interface 7 Package F Generalization T Association T Aggregation rad f k egi I Ol E omposition F k Symbol s Properties 7 Interf
6. described above and also make sure the name and constraint details are displayed as shown opposite i incomplete disjoint patient type ie ii apm atl te ee oe ee n robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class_2007 doc Page 8 of 12 ce ay UML Class diagrams with MagicDraw You can see what you have done by looking at the containment panel on the left hand side of the screen J E Contai Inherit 2 Diagrams lt gt Model E overview Conkainment ele 3 Ae Data Mote E Relations l p abe Text Box By clicking on the new generalisation amr a Standard Profile UML_Standard_Frofile xml aoe L set we have created in the containment H E Client pane and selecting specificationfrom the E E Employee 7 le popup menu we can see the two H E holiday 7 Dependency generalisation associations which form BES Pee Image Shape part of this set H E registered A Student Separator 7 i v Worker ES Class Diagram snr overvi Class 5 Interface Mew Element b New Relation b B Package 7 7 em a Generalization k ae ein elated Element A Generalization Set patient_type Stereotype Rename E3 t 1 e History 4 patient_type E Copy Er atient type patient_type Es Documentation Hyperlinks l iene l Inner Elements ie ot a oe Properties Standatd
7. UML Class Diagrams with Magicdraw Robin Beaumont robin organplayers co uk Tuesday 04 October 2011 Contents 1 INTFOCUCTION cccceecceecceeeeseceeeteeeceeeseeenecaueteeeteeesaeeenessueteestaeesaeeeaetsueteeetaeenaeeasetenes 2 1 1 Where to obtain the SOfWALEC ccccccccccccccesecceceeceeceeeeceeceeceeceeeecesseuscesseusecesseecesseaesessaaeeeessaeess 2 1 2 Before you begin this tutorial ccceccccccssssececceeeeeeecseeeeeececeeaeeeeesseseeeesseeaeeeeesseaaeeeeessaageeeesenas 2 1 3 What are the aims of this practical Chapter ccccccccccseeeceeeceeeeeeeeeeaeeeeeeeseeeeeeeesseaeeeeeeseeseeeeeeeas 2 2 TOEN TAUG ea EE E E I EE E EEE 3 3 Aggregation and Composition cccccccccsecceceeeeeceeeeceeeeseeeeeseeeesseueessaeeesseeeesaeees 4 4 FC CUTS TOM a ca saconeatcudonasaaadoseeaanconnaesedocenmaccocueeanconcaee E 5 5 HVPE Fike GAC I aS AION a E E lt astexssane taxes E E taxon 6 6 Ener iSo S S aa te nn ne ee i ee ee E 7 Z Termnay aS SOC QO ae E E R E R 10 8 Extended EXercliSe cccccssccsseceeeceeeceeeeseceueeeuetseeteeeteeenseeeueeseeteeeteeeeeeenseteneteeeeaeees 12 9 Y eaaa E 12 Video of this practical chapter You can see this tutorial as the videos 6 to 9 in the following playlist at http www youtube com playlist list PL5D590974B7967000 UML Class diagrams with MagicDraw 1 Introduction 1 1 Where to obtain the software This depends on who you are e MSc student
8. ace Reali Das eneralization lt gt h Usage T 1 abstraction E Te aia gt History Generalization Agistered Client registered Instance SSS ee Pal seneralization registered Client oF Link FES Documentation Hyperlinks L yperlin E j eee ES oe Properties Expert aT H Use Case Diagram Conveyed Information an g4 as pP P Bose Inner Elements ar 9 Implementation Di i E Generalization E ite Struct a ast Owner ii omposite ruct EJE j P i 4pplied Stereotype F Information Flows General i Profiling Mechanism Specific 5 Active Hyperlink Lo Generalization Set To Do fa UML 5 a Client ae g H Employs E t ra History 4 patient type HE holiday k fd Pec magpatient type E registgred Ey Documentation Hyperlinks 3 Expert E Stude i Inner Elements eee PropertiesfExpert E Customize pv Tags El Generalization Set Constraints Name patient type Qualified Name patient type Owner Data Applied Stereotype Generalization Powertype Is Disjoint False Is Covering J true 1 Give the generalisation set the name patient_type 2 Set is Disjoint to true you can only be a registered or holliday client 3 Set to covering to false not as in the picture This is the same as complete incomplete Close the dialogue boxs robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts m
9. agicdraw class_2007 doc Page 7 of 12 UML Class diagrams with MagicDraw To get the name of the generalisation set powertype classifier fo appear on the diagram 1 Click on the area of the generalisation line where you have make then both ome together magicdraw automatically recognises them as a set if you have drawn them this way Right mouse click and select Generalisation set from the menu 2 Select the generalisation set you have created earlier 3 You may need to do this for each fork of the line as well Symbolist Properties lt Enter Ungroup Tree Generalization Set patient type And finally to get the constraint details to be displayed El General Fill Color RGE 255 255 204 Use Fill Color False Per Color BARGE 66 66 66 Text Color PGB 0 0 0 Fort Arial 11 in Oe Fe DRE a tru Select in Containment Tree Alt B Stereotype Color E FGE 0 0 0 Related Elements Stereotype Font arial 11 a ed Shew Stereotypes W true Shew Constraints W true Shew Tagged Values W true Ungroup Tree Constraint Text Mode Expression Stereotype Edit Compartment Shew Powertype I False Shew Complete Disjaint W true Shows complete disjoint on the diagram 4oply Style Default Make Default 1 Select the generalisation set name then right mouse click and select Symbol Properties 2 Inthe properties box select Show Complete Disjoint 3 Glick on the OK button Exercise 5 Create the generalisation set
10. can be either qualified or in training which because both are salaried are different from the various other students that are at the PCC Nurses of which there are several varieties carry out consultations home or institutional visits client teaching sessions one to one and group and various clinics such as toddler ulcer and diabetic management Patients can either be registered or visitors either can see a variety of the above people They may see a person for either an individual or a planned series of visits A visit may be a group session consultation or one or more treatments blood and or urine test or just Blood pressure check etc Each clients record has several aspects One aspect consists of one or more Problems which may be open referred being managed or resolved For example a patient presenting with a leg ulcer may be referred by the GP to a practice nurse who will dress the wound until it is healed The GP may request a follow up appointment which may be either a one off event or several Such as every two weeks for 10 weeks Associated with each problem may be specific treatments each which may relate to more than one problem However the treatment will always only relate to a single patient Alternatively the GP may just refer the client to a consultant where the Problem would have the status referred Another aspect of the client s record are the diagnoses Clients may have zero or more diagnoses which may be linke
11. carefully to make them look neat Also check the Youtube video creating recursive associations in UML using Magicdraw at http www youtube com playlist list PL5D590974B7967000 robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class 2007 doc Page 5 of 12 UML Class diagrams with MagicDraw 5 Inheritance Generalisation A good example in the above scenario of where inheritance could be modelled in UML is the sentence Patients can either be registered or visitors You might be thinking that this would best be modelled as simply having an attribute in the PATIENT class indicating that they are either registered or visitors and two of my YouTube videos discuss this point entitled misuses of inheritance On balance the better solution would probably be the attribute rather than inheritance approach here however for now we will assume that we would collect different data about visitors compared to registered patients we might be particularly lazy GPs and not collect a medical history or next of kin information for the visitors just giving then a prescription We have considered patients to be clients in the model because in most of the narrative description this term is used 5 Note abe Text Box 2 Click on the Generalisation icon E Anchor Ji Click on one of the subclasses and then the superclass adjust line contai t 4 pg anmen 4 Repeat step 3 for each subclass Dependency
12. d to a particular problem and or specific treatment sometimes a diagnosis may be a stand alone detail such as Klippel Feil syndrome The client record also contains appointment details which may be either missed attended patient abandoned or practice abandoned once the client actually sees the person usually the person they have the appointment with a visit is recorded The visit can be with anyone discussed above a visit may be with more than on e person such as a GP and a trainee GP The PCC makes use of both the BFI for advice about various treatments as well as an in house formulary both of which are available electronically Another group of people are the administrators who can be employees voluntary workers or students such people operate various phone and reception services offered at the PCC They vary from operating the front desk logging and possibly editing appointments to arranging repeat prescriptions and organizing telephone consultations with GP s or nurses for Blood pressure monitoring and Blood taking amongst other things The voluntary workers are managed by a voluntary worker co coordinator who is also herself a voluntary worker We will not model this entire scenario but take some aspects of it to demonstrate various modelling procedures in Magicdraw Exercise 1 List below where in the above scenario you might want to model Aggregation or composition Recursion Inheritance Ternary associations W
13. e click on the line and then either right mouse click on it E Image Shape to bring up the popup menu and select Specification from it or just EE arator l press the enter key A Class Diagram E Class lt 3 Interface F Package Generalization ki s Association q Aggregation a Composition x Mee Interface Reali Te TE E History 7 Association worker Y Worker ae i Pale ee a l X B E ee en BS BF Properties Expert Paa Customize A Link at Template Parameters E association baits Conyeyed Information t Use Case Diagram ae Inner Elements Mame ualified Name fii Implementation Di E7 Relations A Ta Owner Data Fil Composite Struct g isibili bli Bose Constraints visibility pubIIC W Information Flows mea ee n Mame coordinator Qualified Mame v Worker coordinator To specify the association name ends and multiplicities Navigable true 1 Set Coordinat d tinlicity to 1 Multiplicity l SET name Coordinator and MUTI u WT p y Tope g Default Value t Set other end to name worker and multiplicity 1 Visibility private 3 When complete click on Close Na Association End B Marne worker Qualified Mame Y Worker worker Navigable J true Multiplicity Ja Back Forward Help Exercise 3 Create the recursive association described above you will need to move the various lines and classes
14. e will now look at examples of each of these in turn and see how we can implement them in MagicDraw robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class_ 2007 doc Page 3 of 12 UML Class diagrams with MagicDraw 3 Aggregation and Composition A good example in the above narrative of where aggregation could be modelled in UML is the sentence A Primary care centre PCC consists of Employees Clients patients Voluntary workers and Students First you need to create a new project have given it Create a new blank UML project a igi Specify a project name select a location to store the nenly created project and cick OK 1 the name PCC scenario and specified a new folder for it Name pce scenario You then need to create a new Class diagram follow the steps below to do that lt lt lt lt lt Window Help 1 Click on the class diagram i Agg regation cenario ndzp gt Fa a icon to create anew diagram An aggregation is an association that EF represents a whole part General relationshi p Type Class Digg brn name Overview Composition Select owner For diagram A composition is a form of aggregation with Ep UML Standard Profile UML_Standard_Profile xm stronger ownership and F coincident lifetime of part with the whole 3 Click OK to create and open it gt
15. mplete disjoint employment type d o o as v worker coordinator o incomplete disjoint O patient type worker holiday Ear o o O robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class 2007 doc Page 10 of 12 y 8 4 IE 5 4 Fa a F E oS gregaton a Composition Interface Re A0 Usage os Abstraction Collaboration lA Assocation Directed Association 4 Non navigable Association N ary Association Association Class q Once you have set the persepctive to the appropriate type you will see the N ary option under the Association icon Select it and drop it between the three of Aggregation Directed Association A Composition a Interface Reali ca Usage a Abstraction Instance Link l Use Case Diagram flai Implementation Di Fi Composite Struct Ei Information Flows es Profiling Mechanism ae L jo ne vage A Generalization a Composition lt InterFace Reali xH Neary Association at Usage 2 abstraction J Pd Tek ne Exercise 8 of Aggregation Directed em E Non navigable Association Association Class a Non navigable Associa fincamplete disjoint patient type incomplete disjoint patient_type Edit your diagram to look like the one above The finished result UML Class diagrams with MagicDraw Now to draw the Ass
16. nt of effort is a very useful skill You will soon realise this when you develop your own models where they will probably get changed hundreds of times 9 Summary We have considered in this practical chapter several more advanced UML Class diagram semantics however we have still only really scratched the surface There are a wide range of association line types along with various options that can go with them that we have not considered These will become known to you are you look at the drawing menu palette in detail and search Magicdraw help and the pdf user manual also in the help option Two aspects that people often get bogged down with are stereotypes and Packages both of these have deliberately avoided but you can find out more details about them in my Introduction to Class modelling using UML chapter Also have deliberately not introduced the complexity of adding methods to each class here but will do so in latter tutorials In the previous tutorial you added attributes to various classes so have included a revision exercise below Exercise 10 1 Please add a number of attributes to each of the classes you have on the diagram Remember this is a proprer UML class diagram so do NOT include foreign keys 2 When you have done that found out a way to e Display the Class diagram showing the attributes for each class e Display the Class diagram hiding the attributes and therefore only displaying the class name
17. ociations unfortunately the options on the drawing palette show the last chosen option so you need to select now N ary Association gt Association to create the three simple associations between the diamond and each of the classes coordinator robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts imagicdraw class 2007 doc Page 11 of 12 UML Class diagrams with MagicDraw 8 Extended Exercise As you will have realised from the above exercises and know from Employee the material you have read the package Data 25 a epee development of any model is an li iterative process After re visiting the narrative and comparing it a with the model on the previous page have again improved it my gt V_Worker fooordinaior Hew model is given opposite en How do you think it improves complete disjoint upon the previous model and employment also do you think it is still lacking E carer type in certain areas I m sure it is complete overlapping worker type n et Exercise 9 complete dis joint clinical subtype Update and edit your model to mimic the one opposite You will need to do this before moving onto the next tutorial concerned with UML sequence diagrams Important note You may think that it is annoying to have to edit change a model after you have developed one but being able to change a model quickly and with the minimum amou
18. s at Edinburgh University or The Royal College of Surgeons Edin will be provided with the software along with the academic licence e All others can obtain the software by visiting and registering at http Wwww magicdraw com for the free community edition An alternative with a similar interface is Visual Paradigm VP UML 1 2 Before you begin this tutorial Before you work through the appropriate chapters see section 11 at http Awww robin beaumont co uk virtualclassroom contents html 1 3 What are the aims of this practical chapter This chapter is the second in a series of practical tutorials to introduce you to using a specific CASE tool MagicDraw Personal Edition MD PA This practical chapter assumes that you have worked through the first tutorial so in several places briefly describes what to do By the end of this tutorial you will feel confident about using MD PA to draw UML compliant Class diagrams This tutorial will make use of a specific narrative given on the next page robin organplayers co uk D web_sites_mine Hlcourseweb new chap11 case_tool_tuts magicdraw class 2007 doc Page 2 of 12 UML Class diagrams with MagicDraw 2 The Narrative A Primary care centre PCC consists of Employees Clients patients Voluntary workers and Students In terms of how the employees are paid they are classified as being either casual part time full time or honorary staff General Practitioners a particular group of employees

Download Pdf Manuals

image

Related Search

Related Contents

USER MANUAL  "service manual"  ホワイト ネイビー 主な特長 1. ジョギング対応 時速約6km以上の速歩や  TWR-WIFI-AR4100 - Freescale Semiconductor  取扱説明書(PDF) - キシデン工業株式会社  Rollei NGA-54N  IS 7/98 new  Emerson CP200 Data Sheet  Premier Mounts APP-4872  Untitled  

Copyright © All rights reserved.
Failed to retrieve file