Tanager
Operation Contract Specification
Version 2.0 – Elaboration Phase 2
Revision History
|
Date |
Version |
Description |
Author |
|
06 Feb, 2006 |
1.0 – Elaboration Phase 1 |
Initial Revision. Added operation contracts for operations discovered in Power On and Download A Song main success scenarios. |
Bob Lavey |
|
14 Sep, 2006 |
1.1 – Elaboration Phase 1 |
Added operation contract for operations discovered in Power Off main success scenario. |
Bob Lavey |
|
22 Oct, 2006 |
1.2 – Elaboration Phase 1 |
Revised with comments from Dr. Leavens’ review. |
Bob Lavey |
|
24 Oct, 2006 |
1.3 – Elaboration Phase 1 |
Modified operation contracts for operations in Download a Song main success scenario. |
Bob Lavey |
|
11 Nov, 2006 |
Reordered operations to put them in alphabetical order. Added operations discovered in Play Music and Pause Music scenarios. |
Bob Lavey |
Table of Contents
1.3. Definitions,
Acronyms, and Abbreviations
Operation Contract Specification
This document provides the Operation Contracts for the Tanager project. Operation Contracts will be generated from the System Sequence Diagrams and show the public interface for the Tanager system. The Operation Contracts will show the relationship between calls made on the public interface and changes made in the Domain Model.
This document describes the Operation Contracts for the Tanager project.
A complete list of definitions, acronyms, and abbreviations can be found in the Tanager Glossary.
Tanager Use Case Specification. 2007. Bob Lavey. 10 January, 2007 <TanagerUseCaseModel.htm>.
Tanager System Scenario Diagram Specification. 2006. Bob Lavey. 03 December, 2006 <TanagerSystemSequenceDiagramSpecification.htm>.
Tanager Domain Model. 2006. Bob Lavey. 15 October, 2006 <TanagerSystemSequenceDiagramSpecification.htm>.
This document will provide a more detailed view of the public interface to the Tanager system. It will describe how the users will use the system, and how they expect the system to behave.
Add externally-visible state diagram here…
· If playing, PlaySong() will be ignored()
· Invalid to call PlaySong() if PlaySong() has already been called and state has not changed to Playing
· If paused, PlaySong will cause last known song to be played
|
Operation |
DownloadSong(filename: String) |
|
Cross References |
Use Cases: Download A Song |
|
Preconditions |
The systemState.state is RequestingDownloadSongData |
|
Postconditions |
· A new Song instance, song, was created with the given filename and the current date, and it was associated with the Playlist instance · The new Song instance wrote itself to the FileStore · systemState.state was changed to Idle |
|
Operation |
Pause() |
|
Cross References |
Use Cases: Pause Music |
|
Preconditions |
systemState.state is Playing. |
|
Postconditions |
· systemState.state was changed to Paused · The song that was playing and the point at which it was paused were saved to the SystemState instance · The song that was playing has stopped · The SystemState instance, systemState was saved to non-volatile storage |
|
Operation |
Play() |
|
Cross References |
Use Cases: Play Music |
|
Preconditions |
systemState.state is Paused or Idle. |
|
Postconditions |
· systemState.state was changed to Playing · If the system was in the Paused state, the paused song has resumed playing from the point at which it had been paused. · If the system was in the Idle state, the first song from the playlist has begun playing · The SystemState instance, systemState was saved to non-volatile storage |
|
Operation |
PowerOff() |
|
Cross References |
Use Cases: Power Off |
|
Preconditions |
The system was previously powered on. |
|
Postconditions |
· The SystemState instance, systemState was saved to non-volatile storage · The SongCollection instance, songCollection, was saved to non-volatile storage · The application exited |
|
PowerOn() |
|
|
Cross References |
Use Cases: Power On |
|
Preconditions |
None |
|
Postconditions |
· A MusicPlayer instance, musicPlayer, was created · A SystemState instance, systemState was created and was associated with the MusicPlayer instance · A Playlist instance, playlist, was created and was associated with the MusicPlayer instance · A SongCollection instance, songCollection, was created and was associated with the Playlist instance · A Song instance was created for each file found in the FileStore, and each Song instance was associated with the SongCollection instance |
|
Operation |
StartDownloadProcess() |
|
Cross References |
Use Cases: Download A Song |
|
Preconditions |
systemState.state is Idle |
|
Postconditions |
· systemState.state was changed to RequestingDownloadSongData |