Repository Use Cases and CRUD Repository Use Cases






- Slides: 6
Repository Use Cases and CRUD
Repository Use Cases There are four main operations that are commonly performed on repositories, whether they are files or true databases: Create – create and add an item to the repository Read – view a repository item Update – edit a repository item Delete – remove a repository item These operations are collectively known as CRUD. ¨ ¨ In most applications, there will be at least one CRUD use case. For example, this semester’s project may include a CRUD use case for maintaining the repository of CS, IS, and GEP courses. You may also have other repositories that require maintenance. The following slides show a suggested way in which you can handle CRUD use cases in your SRS. CMSC 345, Version 1/11 2
Suggested Approach for Our Class n n n Have a top-level use called something like Maintain X Repository (e. g. , Maintain Accounts Repository) Write a corresponding specification for this use case. The use case should include viewing the repository as one of the steps in the Main Scenario. Draw a sub-use case diagram for Maintain X Repository that has three extensions for creating an item (e. g. , Create Account) in the X repository, ¨ editing an item in the X repository, and ¨ deleting an item from the X repository. ¨ n For our class, you do not need to have a specification for each of these three extended use cases. (In industry, these might need to be written. ) CMSC 345, Version 1/11 3
Top-level use case diagram with a CRUD use case system name 1 Use Case 1 Name 2 Use Case 2 Name 3 Maintain X Repository role name n Use Case n Name CMSC 345, Version 1/11 external system name CRUD use case 4
CRUD Use Case Specification Number 3 Name Maintain X Repository Summary User adds to, edits, or deletes from X repository Priority 5 Preconditions precondition Postconditions postcondition Primary Actor(s) role name Secondary Actor(s) external system name Trigger User chooses to maintain X repository Main Scenario Step Extensions Open Issues CMSC 345, Version 1/11 Action 1 System displays repository 2 User performs repository operation 3 System updates repository Step Branching Action 2 a Use Case 3 a: Create Y 2 b Use Case 3 b: Edit Y 2 c Use Case 3 c: Delete Y open issue 5
CRUD Sub-Use Case Diagram 3 c Delete Y 3 Maintain X Repository role name 3 b Edit Y 3 a Create Y “Y” is one of the items in the “X” repository CMSC 345, Version 1/11 external system name All dependencies are extend unless stereotyped otherwise. 6