Coffee Control System

1 - System and Interacting System - System Object Model

System Requirements Statement - Coffee Control System

The Coffee Control System is a S/W program attached to Coffee Equipment to control coffee item information. The Coffee Control System responds to the following commands initiated by a user or supervisor to fill and dispense items (coffee, cups, sugar, and cream): Fill Cup, Fill Coffee, Fill Sugar, Fill Cream, Dispense Cup, Dispense Coffee, Dispense Sugar, Dispense Cream, Get Current Cups, Get Current Coffees, Get Current Sugars, Get Current Creams.

The Coffee Control System responds to these commands by returning information and by issuing the following responses to the Coffee Equipment: Show Status, Dispense Cup, Dispense Coffee, Dispense Sugar, Dispense Cream.

The following information (data) is passed between the equipment and the Coffee Control System: number of cups, number of coffees, number of sugars, and number of creams.

System Drawing - Coffee Control System


System Block Diagram (Inputs and Outputs) - Coffee Control System


System Diagram (OMT Notation) - Coffee Control System


System Table - Coffee Control System

System Name Attribute NamesSystem Operation Names
CoffeeEquipmentshowStatus dispenseCup dispenseCoffee dispenseSugar dispenseCream
CoffeeControlSystemnumberCups numberCoffees numberSugars numberCreams fillCup fillCoffee fillSugar fillCream dispenseCup dispenseCoffee dispenseSugar dispenseCream getCurrentCups getCurrentCoffees getCurrentSugars getCurrentCreams

System Specification Report - Coffee Control System

System Name: Coffee Control System

System Access: Public

System Imports: NA

Enclosing System: NA

System Description: The Coffee Control System controls the dispensing of cups, coffees, sugars, and creams.

Data Dictionary - Coffee Control System

Entity NameType of Entity Enclosing System
CoffeeEquipmentSystem --
dispenseCupSystem Operation CoffeeEquipment
dispenseCoffeeSystem Operation CoffeeEquipment
dispenseSugarSystem Operation CoffeeEquipment
dispenseCreamSystem Operation CoffeeEquipment
showStatusSystem Operation CoffeeEquipment
CoffeeControlSystemSystem --
numberCupsAttribute CoffeeControlSystem
numberCoffeesAttribute CoffeeControlSystem
numberSugarsAttribute CoffeeControlSystem
numberCreamsAttribute CoffeeControlSystem
fillCupSystem Operation CoffeeControlSystem
fillCoffeeSystem Operation CoffeeControlSystem
fillSugarSystem Operation CoffeeControlSystem
fillCreamSystem Operation CoffeeControlSystem
dispenseCupSystem Operation CoffeeControlSystem
dispenseCoffeeSystem Operation CoffeeControlSystem
dispenseSugarSystem Operation CoffeeControlSystem
dispenseCreamSystem Operation CoffeeControlSystem
getCurrentCupsSystem Operation CoffeeControlSystem
getCurrentCoffeesSystem Operation CoffeeControlSystem
getCurrentSugarsSystem Operation CoffeeControlSystem
getCurrentCreamsSystem Operation CoffeeControlSystem

2 - System Input and Output Events - System Dynamic Model

System Use Case Diagram - Coffee Control System


System Use Cases/Sub-use Cases Table

NumberInitiating Actor Use Case

/Sub-use Case

Description
1Maintainer Fill Coffee ItemsCoffee Control System sets the number to 500 and initiates a showStatus event. Maintainer may initiate a getCurrentCoffee, getCurrentCups, getCurrentSuggars, or getCurrentCreams
1.1MaintainerFill Cup Coffee Control System sets the cup number to 500 and initiates a showStatus event. Maintainer may initiate getCurrentCups.
1.2MaintainerFill Coffee Coffee Control System sets the coffee number to 500 and initiates a showStatus event. Maintainer may initiate getCurrentCoffee
1.4MaintainerFill Sugar Coffee Control System sets the sugar number to 500 and initiates a showStatus event. Maintainer may initiate getCurrentSugarsms
1.4MaintainerFill Cream Coffee Control System sets the cream number to 500 and initiates a showStatus event. Maintainer may initiate getCurrentCreams
2UserDispense Coffee Items Coffee Control System issues a dispense output event.
2.1UserDispense Cup Coffee Control System issues a dispenseCup output event.
2.2UserDispense Coffee Coffee Control System issues a dispenseCoffee output event.
2.3UserDispense Sugar Coffee Control System issues a dispenseSugar output event.
2.4UserDispense Cream Coffee Control System issues a dispenseCream output event.

System Interaction Diagram - Coffee Control System

Note: CoffeeEquipment may issue the following input events: getCurrentCoffee, getCurrentCups, getCurrentSugars, and getCurrentCreams to get the current number of the item.

System Interaction Scenario - Coffee Control System

Use Case Table - Fill Coffee Items Use Case

Sequence #Sender System Receiver SystemInvoked Operation Description
1Coffee EquipmentCoffee Control System fillCupInput Event
2Coffee Control System Coffee EquipmentshowStatus Output Event
3Coffee EquipmentCoffee Control System fillCoffeeInput Event
4Coffee Control System Coffee EquipmentshowStatus Output Event
5Coffee EquipmentCoffee Control System fillSugarInput Event
6Coffee Control System Coffee EquipmentshowStatus Output Event
7Coffee EquipmentCoffee Control System fillCreamInput Event
8Coffee Control System Coffee EquipmentshowStatus Output Event

Note: CoffeeEquipment may issue the following input events: getCurrentCoffee, getCurrentCups, getCurrentSugars, and getCurrentCreams to get the current number of the item.

Use Case Table - Dispense Coffee Items Use Case

Sequence #Sender System Receiver SystemInvoked Operation Description
1Coffee EquipmentCoffee Control System dispenseCupInput Event
2Coffee Control System Coffee EquipmentdispenseCup Output Event
3Coffee EquipmentCoffee Control System dispenseCoffeeInput Event
4Coffee Control System Coffee EquipmentdispenseCoffee Output Event
5Coffee EquipmentCoffee Control System dispenseSugarInput Event
6Coffee Control System Coffee EquipmentdispenseSugar Output Event
7Coffee EquipmentCoffee Control System dispenseCreamInput Event
8Coffee Control System Coffee EquipmentdispenseCream Output Event

Creams (return aNumber) Returns number of creams

3 - System Operations - System Functional Model

System Function Table - Coffee Control System

System Operation Name Input ParametersTransformation Return Type
dispenseCupnumberCups = numberCups - 1 void
dispenseCoffeenumberCoffees = numberCoffees - 1 void
dispenseSugarnumberSugars = numberSugars - 1 void
dispenseCreamnumberCreams = numberCreams - 1 void
fillCupnumberCups = 500 void
fillCoffeenumberCoffees = 500 void
fillSugarnumberSugars = 500 void
fillCreamnumberCreams = 500 void
getCurrentCups void
getCurrentCoffees void
getCurrentSugars void
getCurrentCreams void

Note: correctness assertions must be added to ensure a positive number of items exists before a dispense operation is executed.

4 - Classes and Relationships - Object Model

Class Diagram - Coffee Control System


Class Table - Coffee Control System

Class NameAttribute Names Relationship Traversal Path Names Operation Names
Itemnumber getNumber setNumber fill getCurrentItems dispense
Cup dispense
Coffee dispense
Sugar dispense
Cream dispense
CoffeeControllertheCup theCoffee theSugar theCream fill dispense getCurrentItems
UserInterfacetheCoffeeController fillCup fillCoffee fillSugar fillCream dispenseCup dispenseCoffee dispenseSugar dispenseCream getCurrentCups getCurrentCoffees getCurrentSugars getCurrentCreams

Data Dictionary for Object Model - Coffee Control System

Entity NameType of Entity Enclosing Class
numberAttributeItem
ItemClass--
CupClass--
CoffeeClass--
SugarClass--
CreamClass--
CoffeeControllerClass --
UserInterfaceClass--
getNumberOperationItem
setNumberOperationItem
fillOperationItem
getCurrentItemsOperation Item
dispenseOperationItem
dispenseOperationCup
dispenseOperationCoffee
dispenseOperationSugar
dispenseOperationCream
fillOperationCoffeeController
dispenseOperationCoffeeController
getCurrentItemsOperation CoffeeController
fillCupOperationUserInterface
fillCoffeeOperation UserInterface
fillSugarOperationUserInterface
fillCreamOperationUserInterface
dispenseCupOperation UserInterface
dispenseCoffeeOperation UserInterface
dispenseSugarOperation UserInterface
dispenseCreamOperation UserInterface
getCurrentCupsOperation UserInterface
getCurrentCoffeesOperation UserInterface
getCurrentSugarsOperation UserInterface
getCurrentCreamsOperation UserInterface
theCupTraversal Path for 1:1 Aggregation CoffeeController
theCoffeeTraversal Path for 1:1 Aggregation CoffeeController
theSugarTraversal Path for 1:1 Aggregation CoffeeController
theCreamTraversal Path for 1:1 Aggregation CoffeeController
theCoffeeControllerTraversal Path for 1:1 Aggregation UserInterface

5 - Objects and Messages - Dynamic Model

Object Interaction Diagram - Fill Items Use Case


Object Interaction Scenario - Fill Items Use Case

Sequence #Sender System/Object Receiver System/ObjectInvoked Operation Description
1Coffee EquipmenttheUserInterface fillCupInput Event
2theUserInterfacetheCoffeeController fillCupMessage
3theCoffeeController theCupfillMessage
4theUserInterfaceCoffee Equipment showStatusOutput Event
5Coffee EquipmenttheUserInterface fillCoffeeInput Event
6theUserInterfacetheCoffeeController fillCoffeeMessage
7theCoffeeController theCoffeefillMessage
8theUserInterfaceCoffee Equipment showStatusOutput Event
9Coffee EquipmenttheUserInterface fillSugarInput Event
10theUserInterfacetheCoffeeController fillSugarMessage
11theCoffeeController theSugarfillMessage
12theUserInterfaceCoffee Equipment showStatusOutput Event
13Coffee EquipmenttheUserInterface fillCreamInput Event
14theUserInterfacetheCoffeeController fillCreamMessage
15theCoffeeController theCreamfillMessage
16theUserInterfaceCoffee Equipment showStatusOutput Event

Object Interaction Diagram - Dispense Items Use Case


Object Interaction Table - Dispense Items Use Case

Sequence #Sender System/Object Receiver System/ObjectInvoked Operation Description
1Coffee EquipmenttheUserInterface dispenseCupInput Event
2theUserInterfacetheCoffeeController dispenseCupMessage
3theCoffeeController theCupdispenseMessage
4theUserInterfaceCoffee Equipment dispenseCupOutput Event
5Coffee EquipmenttheUserInterface dispenseCoffeeInput Event
6theUserInterfacetheCoffeeController dispenseCoffeeMessage
7theCoffeeController theCoffeedispenseMessage
8theUserInterfaceCoffee Equipment dispenseCoffeeOutput Event
9Coffee EquipmenttheUserInterface dispenseSugarInput Event
10theUserInterfacetheCoffeeController dispenseSugarMessage
11theCoffeeController theSugardispenseMessage
12theUserInterfaceCoffee Equipment dispenseSugarOutput Event
13Coffee EquipmenttheUserInterface dispenseCreamInput Event
14theUserInterfacetheCoffeeController dispenseCreamMessage
15theCoffeeController theCreamdispenseMessage
16theUserInterfaceCoffee Equipment dispenseCreamOutput Event

6 - Transformations and Correctness Assertions - Functional Model

Class NameOperation Name Input ParametersTransformation Return Type
ItemgetNumber int
ItemsetNumberint aNumber number = aNumbervoid
Itemfill number = 500void
ItemgetCurrentItems int
Itemdispense void
Cupdispense number = number - 1void
Coffeedispense number = number - 1void
Sugardispense number = number - 1void
Creamdispense number = number - 1void
CoffeeControllerfill Item* theItemvoid
CoffeeControllerdispense Item* theItemvoid
CoffeeControllergetCurrentItems Item* theItemint
UserInterfacefillCup void
UserInterfacefillCoffee void
UserInterfacefillSugar void
UserInterfacefillCream void
UserInterfacedispenseCup void
UserInterfacedispenseCoffee void
UserInterfacedispenseSugar void
UserInterfacedispenseCream void
UserInterfacegetCurrentCups int
UserInterfacegetCurrentCoffees int
UserInterfacegetCurrentSugars int
UserInterfacegetCurrentCreams int

Note: correctness assertions must be added to ensure a positive number of items exists before a dispense operation is executed.

C++ Source Code - Coffee Control System

(Generated code and main combined into a single file. No correctness assertions provided. cout statements simulate output event showStatus.)

////////Coffee Control System Prototype////////////////////////

#include <iostream.h>

////////////////////////////////////////////////////////////////

class Item // Base Class

{ // Abstract Class with

private: // at least one pure virtual

int number; // function. Cannot declare

protected: // an an object of an abstract class

int getNumber () {return number;}; // Accessor Function

void setNumber (int aNumber) {number = aNumber;};

//Accessor Function public:

Item ();

void fill ();

int getCurrentItems (){return getNumber();}

virtual void dispense () = 0; //Pure Virtual Function = 0

}; //Put definition in derived classes

Item::Item () {setNumber (0);} //Constructor

void Item::fill () {setNumber (500);}

///////////////////////////////////////////////////////////////

class Cup : public Item // Derived Class

{

public:

Cup ();

void dispense ();

};

Cup::Cup () : Item () {}

//add cup specialized code

void Cup :: dispense () {int aNumber = getNumber() - 1; setNumber (aNumber);

cout << "\nOne cup dispensed - number remaining is " << getNumber();

}

///////////////////////////////////////////////////////////////

class Coffee : public Item // Derived Class

{

public:

Coffee ();

void dispense ();

};

Coffee::Coffee () : Item () {}

//add coffee specialized code

void Coffee :: dispense (){int aNumber = getNumber() - 1; setNumber (aNumber);

cout << "\nOne coffee dispensed - number remaining is " << getNumber();

}

///////////////////////////////////////////////////////////////

class Sugar : public Item // Derived Class

{

public:

Sugar ();

void dispense ();

};

Sugar::Sugar () : Item () {}

//add sugar specialized code

void Sugar :: dispense () {int aNumber = getNumber() - 1; setNumber (aNumber);

cout << "\nOne sugar dispensed - number remaining is " << getNumber();

}

///////////////////////////////////////////////////////////////

class Cream : public Item // Derived Class

{

public:

Cream ();

void dispense ();

};

Cream::Cream () : Item () {}

//add specialized code

void Cream::dispense () {int aNumber = getNumber() - 1; setNumber (aNumber);

cout << "\nOne cream dispensed - number remaining is " << getNumber();

}

//////////////////////////////////////////////////////////////

class CoffeeController // Class

{ public:

Cup theCup;

Coffee theCoffee;

Sugar theSugar;

Cream theCream;

CoffeeController ();

void fill (Item *theItem);

void dispense (Item *theItem);

int getCurrentItems (Item *theItem);

};

CoffeeController::CoffeeController(){}

void CoffeeController::fill (Item *theItem)

{ theItem->fill(); }

void CoffeeController::dispense (Item *theItem)

{ theItem->dispense(); }

int CoffeeController::getCurrentItems (Item *theItem)

{int aNumber = theItem -> getCurrentItems (); return aNumber; }

//////////////////////////////////////////////////////////////

class UserInterface

{ CoffeeController theCoffeeController;

public:

void fillCup () {theCoffeeController.fill (&theCoffeeController.theCup);

cout << "Cups filled.\n"; }

void fillCoffee () {theCoffeeController.fill (&theCoffeeController.theCoffee);

cout << "Coffee filled.\n";

}

void fillSugar () {theCoffeeController.fill (&theCoffeeController.theSugar);

cout << "Sugar filled.\n";

}

void fillCream () {theCoffeeController.fill (&theCoffeeController.theCream);

cout << "Cream filled.\n";

}

void dispenseCup () {theCoffeeController.dispense (&theCoffeeController.theCup);

cout << "Cup dispensed.\n";

}

void dispenseCoffee () {theCoffeeController.dispense (&theCoffeeController.theCoffee);

cout << "Coffee dispensed.\n";

}

void dispenseSugar () {theCoffeeController.dispense (&theCoffeeController.theSugar);

cout << "Sugar dispensed.\n";

}

void dispenseCream () {theCoffeeController.dispense (&theCoffeeController.theCream);

cout << "Cream dispensed.\n";

}

void getCurrentCups () {

cout << "The current number of cups is ";

cout << theCoffeeController.getCurrentItems (&theCoffeeController.theCup);

cout << ".\n";

}

void getCurrentCoffees () {

cout << "The current number of coffees is ";

cout << theCoffeeController.getCurrentItems (&theCoffeeController.theCoffee);

cout << ".\n";

}

void getCurrentSugars () {

cout << "The current number of sugars is ";

cout << theCoffeeController.getCurrentItems (&theCoffeeController.theSugar);

cout << ".\n";

}

void getCurrentCreams () {

cout << "The current number of creams is ";

cout << theCoffeeController.getCurrentItems (&theCoffeeController.theCream);

cout << ".\n";

}

};

main ()

{ UserInterface theUserInterface;

theUserInterface.fillCup ();

theUserInterface.fillCoffee ();

theUserInterface.fillSugar ();

theUserInterface.fillCream ();

theUserInterface.dispenseCup ();

theUserInterface.getCurrentCups ();

theUserInterface.dispenseCoffee ();

theUserInterface.getCurrentCoffees ();

theUserInterface.dispenseSugar ();

theUserInterface.getCurrentSugars ();

theUserInterface.dispenseCream ();

theUserInterface.getCurrentCreams ();

return (0);

}

/* ------------------ Output --------------------------------

Cups filled.

Coffee filled.

Sugar filled.

Cream filled.

One cup dispensed - number remaining is 499.

One coffee dispensed - number remaining is 499.

One sugar dispensed - number remaining is 499.

One cream dispensed - number remaining is 499.

The current number of cups is 499.

The current number of coffees is 499.

The current number of sugars is 499.

The current number of creams is 499.

*/

cialis link tw886to generic cialis prices best price viagra cialis cialis attorney cincinnati cialis lowest price generic cialis trial packs black buy casino cialis diet followup gambling health jack phentermine poker post viagra cialis and bodybuilding cialis medication free generic cialis samples black buy casino cialis diet followup gambling jack online order phentermine poker post viagra cialis black box cialis message boards generic cialis american express apotheke cialis cialis and levitra and viagra and generic cialis muscle ache generic cialis hong kong archive blog cialis inurl cialis and levitra cialis line mexico does cialis work for women allowed black buy casino cialis diet holdem jack online order phentermine poker tag texas viagra xhtml cialis and multiple coitus cialis no prescription generic cialis price best for premature ejaculation viagra cialis levitra cialis and women cialis link liracrogreekbostoncom generic cialis allowed casino cialis diet phentermine poker tag viagra xhtml cialis add url cialis lawyer ohio experience cialis without ed allowed cialis phentermine tag viagra xhtml cialis back pain cialis online order how to get free cialis sample black buy casino cialis diet gambling jack order phentermine poker tag viagra xhtml cialis discount cialis maximum dose international order for generic cialis blogid buy casino cialis generic inurl order phentermine poker viagra cialis and blood pressure cialis mexico is cialis for me blogid buy casino cialis inurl phentermine poker viagra cialis and grapefruit cialis levitra viagra discount cialis best buy cialis generic ciales rock climbing cialis international shipping does cialis or levitra work best for diabetics allowed black buy casino cialis diet health jack phentermine poker sex tag title viagra xhtml cheap viagra cialis cialis lawyer cincinnati effectiveness of cialis reported allowed black casino cialis diet gambling jack phentermine poker tag viagra xhtml cheapest and cialis and generic and lowest price cialis injury attorney ohio compare levitra and cialis add cialis link suggest catholic cult and cialis cialis lcos lily online free cialis approval cialis fda cialis and early ejaculation cialis levitra viagra interaction generic cialis cheap free shipping free consultation articles on cialis cheapest cialis cialis injury lawyer columbus generic cialis international shipping buy cheapest cialis cialis compare levitra viagra cialis line prescription generic cialis next day black buy casino cheap cialis diet followup gambling health jack online order phentermine poker post viagra ciales cialis international shipping contact number cialis add buy cialis url cialis 20mg tablet cialis liquid how long does cialis take to work black buy casino cialis diet gambling health jack phentermine poker tag viagra xhtml cialis and alcohol cialis lawyer cleveland effectiveness viagra cialis levitra allowed casino cialis phentermine tag viagra xhtml cheapest cialis free samples cialis levitra versus versus viagra fda pharmaceutical testing trials cialis anti cialis impotence cheapest cialis price cialis injury attorney columbus compare viagra cialis and levitra add cialis site cheapest cialis with no perscription cialis injury lawyer cleveland compare viagra to cialis achat ligne cialis cheap cialis link suggest cialis impotence drug cialis with no prescription add buy cialis site canada cialis online cialis information prescribing cialis viagra taken together where can i buy cialis online black buy casino cialis diet followup gambling jack order phentermine poker post viagra cialis blindness cialis link suggest diabeties viagra cialis levitra allowed black buy casino cialis diet gambling jack order phentermine poker tag viagra xhtml cheap cialis online cialis generic tadalafil cialis without prescriptions add cialis generic link cialis and levitra taken together cialis information clinical trial testing cialis for high blood preasure add cialis link online canada generic cialis cialis germany cialis strength time line to buy without prescription cialis or levitra in detrit area buy cialis submit=buy cialis cialis drug interaction cialis online liquid cialis black buy casino cialis diet followup gambling jack low online order phentermine poker viagra cialis attorney cleveland cialis injury lawyer cincinnati cialis vs viagra .. can you take cialis with viagra cialis home page cialis western open ticket add buy cialis link canada cialis generic cialis generic online cialis uprima viagra value pharmaceuticals cialis buy cialis order cialis eli lilly cialis pharmacy natural supplement like cialis