Tanager
Operation Contract Specification
Version 4.2 – Elaboration Phase 4
Table of Contents
1.3. Definitions,
Acronyms, and Abbreviations
2. Externally-Visible
State Diagram
2.1. Application
State Diagram
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.
All diagrams in this document were generated using Gentleware’s Poseidon for UML tool.
Larman, Craig. 2005.
Applying UML and Patterns.
Poseidon for UML.
2005. Gentleware AG. 20 January, 2007 <http://www.gentleware.com/uml-software-pe.html>.
Tanager Domain Model. 2006. Bob Lavey. 20 January, 2007 <TanagerSystemSequenceDiagramSpecification.htm>.
Tanager System Sequence Diagram Specification. 2007. Bob Lavey. 25 January, 2007 <TanagerSystemSequenceDiagramSpecification.htm>.
Tanager Use Case Specification. 2007. Bob Lavey. 19 January, 2007 <TanagerUseCaseModel.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.
|
Operation |
DeleteSong(uuid: UUID) |
|
Cross References |
Use Cases: Delete A Song |
|
Preconditions |
None |
|
Postconditions |
· The Song instance, song, with the given UUID was removed from the current playlist · The Song instance, song, with the given UUID was destroyed |
|
Operation |
DownloadSong(filename: String) |
|
Cross References |
Use Cases: Download A Song |
|
Preconditions |
None |
|
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 was written to the FileStore |
|
Operation |
GetPlaylist(): PlaylistView |
|
Cross References |
Use Cases: View Playlist, Delete a Song |
|
Preconditions |
None |
|
Postconditions |
· A new PlaylistView instance, playlistView was created · The new PlaylistView instance was returned to the called |
|
Operation |
GetPlaylistTypes(): PlaylistTypeList |
|
Cross References |
Use Cases: Select Playlist |
|
Preconditions |
None |
|
Postconditions |
· A new PlaylistTypeList instance, playlistTypeList was created · The new PlaylistTypeList was populated with all the available playlist types · The new PlaylistTypeList instance was returned to the called |
|
Operation |
GetVolume(): int |
|
Cross References |
Use Cases: Volume Adjustments |
|
Preconditions |
None |
|
Postconditions |
· The current volume was returned to the caller |
|
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 system replied that it was ready to exit |
|
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 |
RestartSong() |
|
Cross References |
Use Cases: Restart Current Song |
|
Preconditions |
systemState.state is Playing |
|
Postconditions |
· The song that was playing was restarted from the beginning |
|
Operation |
SelectPlaylistType(PlaylistTypeEnum: playlistType) |
|
Cross References |
Use Cases: SelectPlaylistType |
|
Preconditions |
systemState.state is Idle |
|
Postconditions |
· The new playlist type was used to reorder the collection of downloaded songs · The new playlist type was saved to non-volatile storage |
|
Operation |
SetVolume(volume: int) |
|
Cross References |
Use Cases: Volume Adjustments |
|
Preconditions |
None |
|
Postconditions |
· If the systemState was Playing or Paused, the new volume setting was given to the playing or paused song · The new volume setting was saved to non-volatile storage |
|
Operation |
SkipToPreviousSong() |
|
Cross References |
Use Cases: Skip To Previous Song |
|
Preconditions |
systemState.state is Playing |
|
Postconditions |
· The song that was playing was stopped · If the song that was playing was the first song in the playlist, it was restarted · If the song that was playing was not the first song in the playlist, the previous song in the playlist was started |
|
Operation |
Stop() |
|
Cross References |
Use Cases: Stop Music |
|
Preconditions |
systemState.state is Playing or Paused. |
|
Postconditions |
· If the systemState was Playing, the song that was playing has stopped · systemState.state was changed to Idle · The SystemState instance, systemState was saved to non-volatile storage |
|
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 |
2.0 – Elaboration Phase 2 |
Reordered operations to put them in alphabetical order. Added operations discovered in Play Music and Pause Music scenarios. |
Bob Lavey |
|
11 Dec, 2006 |
3.0 – Elaboration Phase 3 |
Added operations discovered in Stop Music scenario. |
Bob Lavey |
|
30 Dec, 2006 |
3.1 – Elaboration Phase 3 |
Added operations discovered in Enter Menus and Exit Menus scenarios. |
Bob Lavey |
|
13 Jan, 2007 |
3.2 – Elaboration Phase 3 |
Added operations discovered in View Playlist and Delete a Song scenarios. |
Bob Lavey |
|
15 Jan, 2007 |
3.3 – Elaboration Phase 3 |
Added operations discovered in Volume Adjustments scenarios. |
Bob Lavey |
|
15 Jan, 2007 |
3.4 – Elaboration Phase 3 |
Added externally-visible state machine. |
Bob Lavey |
|
19 Jan, 2007 |
3.5 – Elaboration Phase 3 |
Updated based on Dr. Leavens’ review. Removed all discussion of menus, since that is a UI concept. |
Bob Lavey |
|
16 Jan, 2007 |
4.0 – Elaboration Phase 4 |
Added operations discovered in Select Playlist Type scenario. |
Bob Lavey |
|
20 Jan, 2007 |
4.1 – Elaboration Phase 4 |
Added operations discovered in Restart Current Song scenario. |
Bob Lavey |
|
25 Jan, 2007 |
Added operations discovered in Skip to Previous Song scenario. Updated Application State Machine, and added UI State Machine. |
Bob Lavey |