Star UML 1 - Review - Lecture notes 3 PDF

Title Star UML 1 - Review - Lecture notes 3
Course Software Engineering
Institution Coventry University
Pages 11
File Size 924.6 KB
File Type PDF
Total Downloads 90
Total Views 172

Summary

PREP FOR TUTORIAL...


Description

StarUML Lab one:

Review of Use Case diagrams including generalizations, and .

Important notes: 1. To delete any part of your model, right click and select Edit then Delete from Model. Do not press the Delete key or Delete menu, as it only removes it from the screen. 2. To save your file, go to File/Save (or Save As) and select the location H: drive (your home drive) or a USB device. (Failing to do so, you may not find your file next time.)

When you open StarUML you are presented with a dialogue box, showing the Default Approach option. Click OK.

S

© Coventry University

Compiled by Dr. YL Hedley

1

How to create Use Case diagrams Use Case diagrams represent a high level view of the system from the User’s point of view.

1. In the Model Explorer window, click on to expand it.

next to Use Case Model

2. Click on Main. Go to the Properties window to change the name of diagram from Main to Use Case Diagram.

3. 4. Double click on Untitled. A single click on Untitled and type in Dentist to replace it.

4. Double click on Dentist to display the content. Double click on Use Case Diagram (from Use Case Model) to open it.

© Coventry University

Compiled by Dr. YL Hedley

2

To add actors: 1. Make sure that you select the Use Case Diagram (Use Case Model) window. Click on Actor icon, position pointer where the actor is required on the diagram window and left click again.

2. Re-name Actor by changing name to Receptionist within the highlighted field. Click anywhere outside the field to see the change. If you need to change the actor’s name, double click on the field, and enter a new name. Notes: Actors can be repositioned later by left clicking and dragging as required. Multiple actors can be positioned one after the other by holding down the shift key and selecting Actor icon and left clicking onto diagram window (release the shift key and click in order to drop the last Actor). To add use cases: 1. From diagram toolbox, left click on Use Case icon to select and left click on Diagram window in the required position.

© Coventry University

Compiled by Dr. YL Hedley

3

2. Re-name the use case by changing name to Make Appointment within the highlighted field. Click anywhere outside the field. It is shown as below. Notes: Use cases can be repositioned later by left clicking and dragging as required.

To add associations:

1. From diagram toolbox, left click on DirectedAssociation icon to select. Left click and drag from the appropriate Actor to the Use Case. For example, drag from the actor, Manager, to the use case, Make Appointment. Note: Try to lay out your Use Case Diagram without any crossing associations. 2. Reposition the Actors or Use Cases as required. Note: Direction of arrows. The arrows do not indicate the direction of data flow. Where they are used the normal convention is that the arrow indicates which party initiates the interaction (the system or the actor). In practice many authors use lines with no arrows. To add the system boundary: 1. From diagram toolbox, left click on System Boundary icon to select and left click on Diagram window in required position. Drag it out to the size required as show in an example below.

© Coventry University

Compiled by Dr. YL Hedley

4

Extra features: 1. Use Cases can be in-filled with colour by shift clicking all the Use Cases that you want to colour, then right-click. 2. Select Format a) Click Fill Colour b) Click colour choice, and then click OK.

To save your work: 1. Go to File, Save As, and give a name for the file. Remember to select the location H: drive (your home drive) or a USB device for your file. Failing to do so, you may not find your file next time. To load the models: 1. Go to File, and then select Open. 2. Go to your H: drive and select the file name and click Open.

© Coventry University

Compiled by Dr. YL Hedley

5

Task 1: Recreate the following Use Case Diagram.

© Coventry University

Compiled by Dr. YL Hedley

6

How to Add & Extend is used when you wish to show that one use case is special variant of some main or parent use case. This is useful when there are two or more different scenarios to a use case depending on circumstances. Extend expresses optional or conditional behaviour in the parent use case. Include shows a necessary relationship between two use cases. This relationship can be applied in the following two situations:  when there are common parts in the behaviour of two or more use cases  where a large use case can be simplified by splitting it into several use cases To add : 1. From the diagram toolbox, left click on Extend icon to select. 2. Link the two Use Cases so that the arrow points from the extended Use Case to the base Use Case. For example, link the extended use case, Email Confirmation, to the base use case, Make Appointment (as shown in the diagram on the next page).

To add : 1. From the diagram toolbox, left click on Include icon to select. 2. Link the two Use Cases so that the arrow points from the including use case (base use case) to the included Use Case. For example, link the base use case, Make Appointment, to the included use case, View Dentist (as shown in the diagram on the next page).

Note: The newest UML standard uses dotted line for extend and include.

© Coventry University

Compiled by Dr. YL Hedley

7

Task 2: Add further use cases to your diagram from Task 1 as well as the and associations shown in the following diagram.

© Coventry University

Compiled by Dr. YL Hedley

8

Generalizations (and Specializations) In tasks 1 and 2, we could add an actor called Staff. Staff is generalised role. A staff member could be either a receptionist or a manager. We can indicate this with the generalization association. We can describe the association from both ends. Staff is a generalization (of the general role) of both Receptionist and Manager. Or we could say that the receptionist and manager are particular specializations of a staff member. To add generalizations 1. From diagram toolbox, left click on Generalization icon. Left click and drag from the specialized Actor to the generalized Actor.

Task 3: Add further actors and generalizations to your diagram as shown below.

© Coventry University

Compiled by Dr. YL Hedley

9

UML Notes UML “notes” provide a way of annotating items in a UML diagram using text comments. They are purely for documentation purposes. They do not form part of the model and are not checked by the tool. They add explanations or limitations for the benefit of the readers (developer and/or customer). The text comment appears in the notes symbol and is anchored to its item using a broken line.

To add notes (i.e. comments) to a Use Case diagram (or any other UML diagram) 1. From the toolbox select the Annotation icon. Select the Notes icon. 2. Position the pointer where the note symbol is required in the diagram window, then left click again. 3. Type in the required text comment. When finished left-click outside the not symbol (in empty space). Note: Text comments can be edited by double-clicking on the notes symbol and then typing in the correction. Notes can be repositioned later by left clicking and dragging as required.

To add anchor lines 1. From the toolbox select the NoteLink icon. Left click and drag from the appropriate Note to the item. In a use case diagram the item can be an actor, use case or association.

To bend an anchor line (or an association) 1. Select the line by left clicking on the line. 2. Place pointer near mid-point of line. 3. Hold down left mouse button and drag mid-point anywhere on screen. 4. Release mouse button and the line will retain its kink/bend

© Coventry University

Compiled by Dr. YL Hedley

10

Task 4: Complete your diagram by adding notes and anchor lines as shown below. Note that we have set the note symbols have to no fill Colour. This format makes it clearer that these notes are subsidiary to the main symbols on the diagram.

New scenario exercise 1: Complete the use case diagram based on the scenario below: The administrator in the dental surgery is responsible for: setting up the time slots in the appointment books for bookings and generating a monthly report of appointments booked for the manager. In order to generate monthly booking reports in response to the manager’s request, the administrator is required to view and filter information about the appointments booked at the end of each month. The administrator can then send reports to the manager by email or place reports on the secured network folder to be accessed by the manager.

© Coventry University

Compiled by Dr. YL Hedley

11...


Similar Free PDFs