Tanager

Operation Contract Specification

 

Version 3.5 – Elaboration Phase 3

 

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

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

 


Table of Contents

1.     Introduction. 3

1.1.        Purpose. 3

1.2.        Scope. 3

1.3.        Definitions, Acronyms, and Abbreviations. 3

1.4.        References. 3

1.5.        Overview.. 3

2.     Externally-Visible State Diagram.. 4

3.     Operation Contracts. 6

3.1.        DeleteSong. 6

3.2.        DownloadSong. 6

3.3.        GetPlaylist 6

3.4.        GetVolume. 6

3.5.        Pause. 7

3.6.        Play. 7

3.7.        PowerOff. 7

3.8.        PowerOn. 7

3.9.        SetVolume. 8

3.10.      Stop. 8


 

Operation Contract Specification

1.              Introduction

1.1.         Purpose

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.

1.2.         Scope

This document describes the Operation Contracts for the Tanager project.

1.3.         Definitions, Acronyms, and Abbreviations

A complete list of definitions, acronyms, and abbreviations can be found in the Tanager Glossary.

1.1.         References

Tanager Use Case Specification. 2007.  Bob Lavey.  15 January, 2007 <TanagerUseCaseModel.htm>.

Tanager System Sequence Diagram Specification. 2007.  Bob Lavey.  15 January, 2007 <TanagerSystemSequenceDiagramSpecification.htm>.

Tanager Domain Model. 2006.  Bob Lavey.  15 October, 2006 <TanagerSystemSequenceDiagramSpecification.htm>.

1.2.         Overview

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.


2.              Externally-Visible State Diagram

3.              Operation Contracts

3.1.         DeleteSong

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

3.2.         DownloadSong

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 as written to the FileStore

3.3.         GetPlaylist

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

3.4.         GetVolume

Operation

GetPlaylist(): int

Cross References

Use Cases: Volume Adjustments

Preconditions

None

Postconditions

·    The current volume was returned to the caller

3.5.         Pause

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

3.6.         Play

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

3.7.         PowerOff

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

3.8.         PowerOn

Operation

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

3.9.         SetVolume

Operation

SetPlaylist(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

3.10.     Stop

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