230 likes | 385 Views
Use Cases. Use case. What is a Use Case Diagram ?. A use case diagram illustrates The system and all its actors The use cases developed for the system The interaction between the actors and the use cases. Creating a Use Case diagram. Create a Use Case diagram in the Use Case view
E N D
Use Cases Use case
What is a Use Case Diagram ? • A use case diagram illustrates • The system and all its actors • The use cases developed for the system • The interaction between the actors and the use cases
Creating a Use Case diagram • Create a Use Case diagram in the Use Case view • Add actors, use cases, and relationships • Any number of Use Case diagrams can be created in a Rose model • Use Case diagrams can be nested under any Use Case
Uses and Extends • You can show uses and extends relationships between use cases in the use case diagram • Use the generalization relationship line • For extends, point toward the main use case • For uses, point away from the main use case • In the specification for the relationship, in the stereotype box, put either uses or extends as desired • Right mouse click on the relationship to show the stereotype
Documenting Use Cases • The flow of events for a Use case is described in • Documentation window • High level description of the use case • External documents • Flow of events • Sequence diagrams or Collaboration diagrams • Flow of events
The Documentation Window • The Documentation Window provides the capability to create, view, and/or modify the documentation for a selected item on a diagram • There is only one Documentation Window which is updated as different items on a diagram are selected • The Documentation Window • May be visible or hidden • May be docked or floating
External documents • The flow of events for a use case may be contained in an external document which is linked to the use case • In the use case specification window, select the files tab • Use the right mouse button to insert • You can insert a pointer to any kind of file. Some examples are: • Document files (Frame, SoDA, etc) • URL for a web page
What are Scenarios ? • A scenario is an instance of a use case • Each use case has a web of scenarios • A Primary scenario • All is well • Secondary scenarios • Exceptions and alternatives to the primary scenario • A scenario may be represented in a Sequence Diagram or on a Collaboration Diagram
Creating a Sequence Diagram • Create a sequence diagram nested inside a Use Case in the Use Case view • Add objects, messages, and reflexive messages to the diagram • Message numbering is optional • Any number of sequence diagrams can be nested under a Use Case • Any number of sequence diagrams can be included in a Rose model • An existing message may be moved as more information is discovered • A new message may be inserted anywhere in a Sequence Diagram • Actors can be included on Sequence Diagrams
Additional Elements • Focus of Control represents the relative time that the flow of control is focused in an object • It represents the time an object is directing messages • Scripts are additional text that may be added to a Sequence Diagram. They are used to convey additional information • Comments for complicated interactions • Iteration over a few steps • Simple branching
Collaboration Diagrams • A Collaboration Diagram is an alternate graphical representation of a scenario • Collaboration Diagrams may be created • Independently • Directly from a Sequence Diagram
Creating a Collaboration Diagram • Create a Collaboration Diagram from a Sequence Diagram by selecting the Sequence Diagram and execute Browse:Create Collaboration Diagram • Objects, links, and messages are automatically added • Or create a Collaboration Diagram any time in the usual manner • Add objects and links • Add messages and reflexive messages • Add data flow • Any number of Collaboration Diagrams can be included in a Rose model • Actors can be included on Collaboration Diagrams
Multiple Objects of the Same Class • A message may be sent to multiple objects of the same class • This can be shown by 搒tacking?an object icon
Moving and Inserting Messages • Messages may NOT be moved or inserted in a Collaboration Diagram • A Sequence Diagram must be used • Process • Switch to the Sequence Diagram • Move and/or insert the needed messages • Switch back to the Collaboration Diagram
Exercise: Use Case Diagram • Create the use case diagram for the Course Registration System as shown on page 4
Exercise: Documenting Use Cases • Create the brief description and the flow of events for the 揗aintain Course Info?use case • The use case provides the capability to • Create, modify, and/or delete courses for a semester • Create, modify, and/or delete course offerings (each course has at least one course offering) for a semester • Professors must select courses to teach for a semester before any course offerings may be created • Contained in a printed list available to the Registrar • There cannot be a course offering if a professor is not available to teach the course offering
Important Important Exercise: Drawing a Sequence Diagram • Create a sequence diagram for the primary scenario (all works well) for • Register For Courses, called Create Schedule (include classes): • NewSchedule • ManageSchedule • Course • CourseOffering • Maintain Course Info, called Create a Course (include classes): • ManageCurriculumForm • NewCourseForm • Course • CourseOffering original: NewScheduleForm ManageScheduleForm original: create catalogue
Exercise: Creating a Collaboration Diagram • Create a Collaboration Diagram from the Sequence Diagram
Important Exercise: Create a New Collaboration Diagram • Create a new Collaboration Diagram for the primary scenario of the 揋enerate Catalogue?use case • Name it Create the Catalogue and include classes: • CourseCatalogue • Course • CourseOffering • This use case • Retrieves the name, description, and number of credit hours for each course • Retrieves the location, time, and assigned professor for each course offering • Formats the catalogue • Sends the formatted catalogue information to the printer original: Catalogue