Skip to content

Latest commit

 

History

History

DecoratorPattern

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Starbucks order system

classDiagram

class Beverage {
    <<abstract>>
    +description
    +getDescription()
    +cost()
}

class CondimentDecorator {
    <<abstract>>
    +getDescription()
}

class HouseBlend {
    +cost()
}

class DarkRoast {
    +cost()
}

class Espresso {
    +cost()
}

class Decaf {
    +cost()
}
Beverage <|-- HouseBlend
Beverage <|-- DarkRoast
Beverage <|-- Espresso
Beverage <|-- Decaf
Beverage <-- CondimentDecorator : component

class Milk {
    +Beverage b
    +cost()
    +getDescription()
}

class Mocha {
    +Beverage b
    +cost()
    +getDescription()
}

class Soy {
    +Beverage b
    +cost()
    +getDescription()
}

class Whip {
    +Beverage b
    +cost()
    +getDescription()
}

CondimentDecorator <|-- Milk
CondimentDecorator <|-- Mocha
CondimentDecorator <|-- Soy
CondimentDecorator <|-- Whip
Loading