433-254 Software Design Lab - UML Case Tools: Getting Started
The document provides instructions for using Visual Paradigm software to create UML diagrams, including use case diagrams, class diagrams, and sequence diagrams. It includes steps for starting the software, creating new diagram types, adding elements and relationships to diagrams, and modifying properties of elements. Examples are provided for replicating sample diagrams of a library system and tangram game.
433-254 Software Design Lab - UML Case Tools: Getting Started
The document provides instructions for using Visual Paradigm software to create UML diagrams, including use case diagrams, class diagrams, and sequence diagrams. It includes steps for starting the software, creating new diagram types, adding elements and relationships to diagrams, and modifying properties of elements. Examples are provided for replicating sample diagrams of a library system and tangram game.
Getting Started 1. To start Visual Paradigm, go to: Start All Programs Development Environments Visual Paradigm Visual Paradigm for UML 6.0 Standard Edition 2. After VP-UML starts, it will ask you to selected a workspace. I recommend placing it somewhere on your H drive, for example: H:\254\UML\vpworkspace This is where your les will be saved. 3. You are now in the basic environment of the VP-UML user interface. You most likely will be greeted by the Start Page that says Welcome to Visual Paradigm for UML Standard Edition and has options to Open Project... and New Diagrams. You can return to the Start Page at anytime by going to Window Start Page or by using the tabs that are underneath the tool bar icons. Use Case Diagrams Figure 1 is a use case diagram of a Library system drawn with VP-UML. Try to replicate this diagram. Borrower Issue Fine Library Return Book Librarian Pay Fine Add Item to Catalogue Return Item Borrow Book Search Catalogue Return CD <<Include>> Update Item Availability Borrow Item <<Extend>> <<Extend>> Borrow CD <<Include>> <<Extend>> <<Extend>> Visual Paradigm for UML Standard Edition(The Univresity of Melbourne) Figure 1: Library Use Case Diagram 1. A few ways to create a new Use Case Diagram: (a) From the Start Page in the basic environment of the VP-UML user interface, select New Use Case Diagram from the New Diagrams UML Diagrams. (b) File New Diagram UML Diagrams Use Case Diagram (c) In the Diagram Navigator pane on the left, expand the UML Diagrams folder, right click Use Case Diagram then select New Use case Diagram 2. Adding Use Case Elements: To create a shape, click on a diagram element button from the diagram toolbar on the left of the diagram and click on the diagram pane to create it. The element generated will have a default size. You can also drag a specic boundary before releasing the mouse to dene a shapes initial size. Alternatively, you can also create a diagram element by dragging a diagram element button then dropping it on the diagram pane. 3. Creating Connections: To create a connector, select the desired connector from the diagram toolbar and click on the source shape. Drag the connector to the destination shape. Or you can select the element you wish to create a connector from and connector options from that element will appear. Click and drag an option to connect to the destination shape or an empty space for that element to be created. VP-UML provides continuous UML syntax checking. You will see a stop sign when you try to create an invalid connection. When creating <<extend>> connections, extension points can be hidden by right clicking the use case and unchecking Show Extension Point. Class Diagrams Figure 2 is class diagram of a Tangram system drawn with VP-UML. Try to replicate this diagram. -orientation : double +getAreal() : double +rotate(angle : double) : boolean TangramShape{abstract} +getArea() : double <<Interface>> HasArea -tangrams : TangramShapes[0..7] +Tangram() +getArea() : double +toString() : String Tangram -length : double +TangramSquare(length : double) +getAreal() : double +rotate(angle : double) : boolean TangramSquare -baseLength : double -height : double +TangramTriangle(length : double) +getAreal() : double +rotate(angle : double) : boolean TangramTriagle -length : double -height : double -tiltAngle : double +TangramRhombus(length : double) +getAreal() : double +rotate(angle : double) : boolean TangramRhombus 1 0..7 Visual Paradigm for UML Standard Edition(The Univresity of Melbourne) Figure 2: Tangram Class Diagram 1. A few ways to create a new Use Case Diagram: (a) From the Start Page in the basic environment of the VP-UML user interface, select New Class Diagram from the New Diagrams UML Diagrams. (b) File New Diagram UML Diagrams Class Diagram (c) In the Diagram Navigator pane on the left, expand the UML Diagrams folder, right click Class Diagram then select New Class Diagram 2. Adding Class Diagram Elements: To create a shape, click on a diagram element button from the diagram toolbar on the left of the diagram and click on the diagram pane to create it. The element generated will have a default size. You can also drag a specic boundary before releasing the mouse to dene a shapes initial size. Alternatively, you can also create a diagram element by dragging a diagram element button then dropping it on the diagram pane. 3. Creating Relationships: To create a relationship between classes, click the desired connector from the diagram toolbar, click on the source class then drag the connector to the destination class. Or you can select the class you wish to create a connector from and connector options from that element will appear. Click and drag an option to connect to the destination class or an empty space for a new class to be created. 4. Adding Attributes: To add an attribute. click on the class and select Add Attribute. This will add a new private attribute highlighted in grey. You can now rename the attribute and add the attribute type. To modify the attributes particulars further, either right click the attribute and select Open Specification... or simply push Enter on the keyboard. 5. Adding Methods: To add a class method, right click on the class and select Add operation. This will add a new public method highlighted in grey. You can now rename the method, add the parameter types and names and return type. To modify the methods particulars further, either right click the method and select Open Specification... or simply push Enter on the keyboard. 6. Class Specications: To nd out more about the class, right click the class and choose Open Specification... or simply push Enter on the keyboard. This will take you to the Class Specification menu. There are a number of dierent tabs that give you information about the class. Some of the details listed are attributes, methods and relationships with other classes. To change your class into an abstract class, go to the General tab, select the abstract text box and push the apply button. To make your class an interface, go to the Stereotypes tab, select interface option from the left scroll menu, push the >> button and push the apply button. System Sequence Diagrams Figure 3 is system sequence diagram for an ATM drawn with VP-UML. Try to replicate this diagram. 1. A few ways to create a new System Sequence Diagram: (a) From the Start Page in the basic environment of the VP-UML user interface, select New Sequence Diagram from the New Diagrams UML Diagrams. (b) File New Diagram UML Diagrams Sequence Diagram sd ATM loop [more transactions| Dana:Customer ATM:BankSystem 2: request pin 1: insertCard(card) 4: request transation detail 3: enterPin(pin) 5: enterTransaction(transaction) 6: enterTransaction(end) 7: return card Visual Paradigm for UML Standard Edition(The Univresity of Melbourne) Figure 3: ATM System Sequence Diagram (c) In the Diagram Navigator pane on the left, expand the UML Diagrams folder, right click Sequence Diagram then select New Sequence Diagram 2. Adding System Sequence Diagram Elements: To create a shape, click on a diagram element button from the diagram toolbar on the left of the diagram and click on the diagram pane to create it. The element generated will have a default size. You can also drag a specic boundary before releasing the mouse to dene a shapes initial size. Alternatively, you can also create a diagram element by dragging a diagram element button then dropping it on the diagram pane. 3. Passing Messages: To create a message between systems, click on the system where the message originates. This should show a message option in the form of an arrow. Hovering over the message option shows more message options. Click on the type of message you wish to send. A pop up will appear requesting for your destination. Your message is now created and you can modify the name of the call. In VP-UML, you can also explicitly specify that the message is a call by clicking on the message and clicking on the pop up image that have two arrows pointing right. This gives you a number of options for your message. Clicking on the message arrow will also give you an option for an arrow point back to the origin. Clicking this arrow will produce a dotted arrow for return messages. Messages can also be created by selecting the message you want from the diagram toolbar, clicking the origin and dragging to the destination. 4. Creating Loops: To create a loop, select Loop Combined Fragment from the diagram toolbar. If this option is not shown, click on the black triangle point down next to Alternative Combined Fragment from the diagram toolbar. Loop Combined Fragment should be in the drop down menu. After selecting Loop Combined Fragment from the toolbar, you may place the loop in the diagram the same way you place other diagram element positions. To add the constraint of the loop, go in to the specications of the loop by right click- ing the loop and choosing Open Specification... or simply push Enter on the key- board. Go to the Interaction Operands tab of the specications and double click on the InteractionOperand value in the Name display box or click on it once and click the Open Specification... button. Click the Guard tab and type in the condition for the loop. Click the OK button until you are back in the diagram. Sequence Diagrams Figure 4 is sequence diagram to book a court in a booking system drawn with VP-UML. Try to replicate this diagram. alt [available| [!available| Dana:Student MelbourneGym:BookingSystem newBooking:Booking BM:BookingManager 1: bookCourt(time) 2: available = checkAvailibity(time) 3: create() 5: addBooking(newBooking) 8: no booking made 4: setTime(time) 7: confirm booking, return booking ID, id 6: id = getBookingID() Visual Paradigm for UML Standard Edition(The Univresity of Melbourne) Figure 4: Book Court Sequence Diagram There are only few dierences between drawing system sequence diagrams and sequence diagrams with VP UML. Two new operations are done in this diagram: creation of an object from within an another object, use of an alternative loop. For all other tasks, please follow the instructions from System Sequence Diagrams 1. Creating a new lifeline from within a lifeline: As part of some scenarios, you may need to create a new concept. When this happens, a call to create a new lifeline must be performed. To create a new concept through a message invocation, click on or hover over the system where the message originates. When this happens, an arrow will appear. Hovering your mouse over this arrow will produce a drop down menu of dierent arrow options. Select the arrow that has description Create Message->Lifeline. You can either chose to create the link between the current system to an existing system/lifeline in the digram or a new one. If the lifeline has already been drawn, another way to produce the create message is to choose it in the diagram toolbar, click on the initiating system and drag to the system to be created and then release. 2. Creating Alternatives: To create alternative messages dependent on conditions , select Alternative Combined Fragment from the diagram toolbar. If this option is not shown, click on the black tri- angle point down next to Loop Combined Fragment from the diagram toolbar. Alternative Combined Fragment should be in the drop down menu. After selecting Alternative Combined Fragment from the toolbar, you may place the loop in the diagram the same way you place other diagram element positions. To add constraints of the alternatives, go in to the specications of the alternative by right clicking the alternative and choosing Open Specification... or simply push Enter on the keyboard. Go to the Interaction Operands tab of the specications. In this menu, there are two InteractionOperand options in the Name display box. The rst one is for the rst alternative, the second one is for the second alternative. To update the constraints of each alternative, double click on the InteractionOperand value you wish to modify or click on it once and click the Open Specification... button. Click the Guard tab and type in the contraint for the alternative. Click the OK button until you are back in the diagram. Communication Diagrams Figure 5 is communication diagram to book a court in a booking system drawn with VP-UML. Try to replicate this diagram. 1. A few ways to create a new Communication Diagram: (a) From the Start Page in the basic environment of the VP-UML user interface, select New Communication Diagram from the New Diagrams UML Diagrams. (b) File New Diagram UML Diagrams Sequence Diagram (c) In the Diagram Navigator pane on the left, expand the UML Diagrams folder, right click Sequence Diagram then select New Sequence Diagram 2. Adding Communication Diagram Elements: To create a shape, click on a diagram element button from the diagram toolbar on the left of the diagram and click on the diagram pane to create it. The element generated will have a default size. You can also drag a specic boundary before releasing the mouse to dene a shapes initial size. Alternatively, you can also create a diagram element by dragging a diagram element button then dropping it on the diagram pane. 3. Creating Relationships and Messages: To create a relationship or a message between objects, click the desired connector from the diagram toolbar, click on the source object then drag the connector to the destination object. Or you can select the object you wish to create a connector from and connector options from that element will appear. Click and drag an option to connect to the destination class or an empty space for a new class to be created. Creating a message will automatically create the link. The default numbering will be in the order of creation. To modify the numbering, right click the message and choose Open Specification... or simply push Enter on the keyboard. In this General tab, Sequence no. can be modied. : bookCourt(time) MelbourneGym:BookingSystem BM:BookingManager Dana:Student newBooking:Booking 1: availability = checkAvailibility(time) 2a [available] : newBooking = create() 2b [not available]: no booking made 2a.1: setTime(time) 2a.2: addBooking(newBooking) 2a.4: confirm booking, return booking ID. id 2a.3: id=getBookingID() Visual Paradigm for UML Standard Edition(The Univresity of Melbourne) Figure 5: Book Court Communication Diagram