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

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

 


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.     Operation Contracts. 4

2.1.        DownloadSong. 4

2.2.        Pause. 4

2.3.        Play. 4

2.4.        PowerOff. 5

2.5.        PowerOn. 5

2.6.        StartDownloadProcess. 5


 

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.  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>.

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.              Operation Contracts

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

2.1.         DownloadSong

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

2.2.         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

2.3.         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

2.4.         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 application exited

2.5.         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

2.6.         StartDownloadProcess

Operation

StartDownloadProcess()

Cross References

Use Cases: Download A Song

Preconditions

systemState.state is Idle

Postconditions

·    systemState.state was changed to RequestingDownloadSongData