设计模式
2021-07-28 14:05:03 8 举报
设计模式类图
作者其他创作
大纲/内容
Decaf
-description: String=\"Decaf\"-cost: double=1.05
+getDescription(): String+cost(): double
<<Condimentdecorator>>
+getDescription(): String
Milk
-caffee: Caffee
+Milk(caffee: Caffee)+cost(): double+getDescription(): String
DinnerMenu
-dinnermenu: List<MenuItem>
+DinerMenu()+add(menuComponent: MenuComponent)+get(index: int): MenuItem+iterator(): Iterator
DarkRoast
-description: String=\"DarkRoast\"-cost: double=0.99
PancakeHouseMenu
-menuItems:Vector<MenuItem>
CaffeeMenu
-MAXSIZE: int=128-caffees_size: int-ingredients_size: int-caffees: MenuItem[] -ingredients: MenuItem[]
ManuItem
-name: String-description: String-vegetarian: boolean -price: double
Espresso
-description: String=\"Espresso\"-cost: double=1.99
0 .. *
Manu
+menuComponents: ArrayList<MenuComponent>-name: String -description: String
Soy
-caffee: Caffee
+Soy(caffee: Caffee)+cost(): double+getDescription(): String
<<Caffee>>
+getDescription(): String+cost(): double
Whip
+Soy(caffee: Caffee)+cost(): double+getDescription(): String
Waitress
-currentMenu: Menu
CaffeeMenuIterator
-caffees_size: int-ingredients_size: int-caffees: MenuItem[]-ingredients: MenuItem[]-caffee_index: int-ingredient_index: int
PancakeHouseMenuIterator
-menuItems: Vector<MenuItem>-index: int
+HoseMenuIterator(menuItems: Vector<MenuItem>)+hasNext(): boolean+next(): MenuItem
DinerMenuIterator
-dinnermenu: List<MenuItem> -index: int
+DinerMenuIterator(dinnermenu: List<MenuItem>)+hasNext(): boolean +next(): MenuItem
Mocha
+Mocha(caffee: Caffee)+cost(): double+getDescription(): String
<<Iterator>>
+hasNext(): boolean+next(): Object
<<ManuComponent>>
+add(menuComponent: MenuComponent)+remove(menuComponent: MenuComponent )+getChild(index: int): MenuComponent +getName(): String +getPrice(): double +getDescription(): String +isVegetarian(): boolean +print()
Houseblend
-description: String=\"House Blend Coffee\"-cost: double=0.89
0 条评论
下一页