Brief
Profiles and subscriptions are stored for later retrieval.
Narrative
A client submits a request to the Registration action for a new User account for the username "trillian". The system queries the database
User user = getDatabase().findUser(username); // Database methodto see if the user exists, and then obtains a new User object for "trillian".
user = database.createUser(username); // Database methodThe system stores the User object in the client's session.
setUser(user); // Action callThe client submits a request for a new Subscription for "mail.magrathea.com". After checking to see if the Subscription already exists, the system obtains a new Subscription object from the client's User.
Subscription sub = getUser().createSubscription(host); // Database methodThe system stores the Subscription object in the client's session too.
setSubscription(sub); // Action propertyThe client submits a request that the "mail.magrathea.com" Subscription be deleted. The system obtains the Subscription from the client's User object,
Subscription sub = getUser().findSubscription(host); // Database methodand it asks the User object to remove the Subscription.
getUser().removeSubscription(sub); // Database method via Action propertyThe system asks the Database object to store the changes to the persistence system.
getDatabase().save(); // Database method
Goal
| Goal | Create, retrieve, update, and delete Users and their Subscriptions. | |
|---|---|---|
| Level | Subfunction | (User Goal, Summary, Subfunction) |
| Trigger | System needs to exercise a CRUD operation. | |
| Primary Actor | System |
Main Success Scenario (MSS)
| Step | Action |
|---|---|
| 1 | System requests User object from Database object by providing username |
| 2 | Database provides User object |
| 3 | System updates User object properties |
| 4 | System requests Subscription from User object by providing host name |
| 5 | User object provides the Subscription object |
| 6 | System updates Subscription properties |
| 7 | System requests Subscription be removed by providing the host name |
| 8 | User object removes Subscription |
| 9 | System invokes Database Save command |
| 10 | Database stores Users and Subscriptions to persistance system |
Extensions
| Step | Branching Action |
|---|---|
| 1a | Database object not available |
| .1 | System logs and presents error condition |
| 1b | |
| .1 | Database object returns null to indicate User is not found |
| .2 | System requests new User object for username |
| .3 | Database object registers and returns new User object for username |
| 4a | User returns null to indicate Subscription does not exist |
| .1 | User object returns null to indicate Subscription is not found |
| .2 | System requests new Subscription object for host |
| .3 | Database object registers and returns new Subscription object for host |
Preconditions and Guarantees
| Preconditions | Reference to Database object obtained at system startup |
|---|
