Repository Use Cases and CRUD. 2 CMSC 345, Version 1/11 Repository Use Cases There are four main...
-
Upload
blaze-hardy -
Category
Documents
-
view
215 -
download
1
Transcript of Repository Use Cases and CRUD. 2 CMSC 345, Version 1/11 Repository Use Cases There are four main...
Repository Use Casesand CRUD
2CMSC 345, Version 1/11
Repository Use CasesThere 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.
3CMSC 345, Version 1/11
Suggested Approach for Our Class Have a top-level use case 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.
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.)
4CMSC 345, Version 1/11
1Use Case 1 Name
2Use Case 2 Name
3Maintain
X Repository
system name
role name
external system name
nUse Case n Name
CRUD use case
Top-level use case diagram with a CRUD use case
5CMSC 345, Version 1/11
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 Action
1 System displays repository
2 User performs repository operation
3 System updates repository
Extensions Step Branching Action
2a Use Case 3a: Create Y
2b Use Case 3b: Edit Y
2c Use Case 3c: Delete Y
Open Issues open issue
CRUD Use Case Specification
6CMSC 345, Version 1/11
3Maintain
X Repositoryrole name
external system name
3bEditY
3cDelete
Y
3aCreate
Y
All dependencies are extend unless stereotyped otherwise.
“Y” is one of the items in the “X” repository
CRUD Sub-Use Case Diagram