ice cream model
Download
Skip this Video
Download Presentation
Ice Cream Model

Loading in 2 Seconds...

play fullscreen
1 / 12

Ice Cream Model - PowerPoint PPT Presentation


  • 230 Views
  • Uploaded on

Ice Cream Model. If( f.equals( “vanilla” ) ){ // do something }else if ( f.equals( “chocolate” ) ){ // do something else } Cream aCream = new Cream(); aCream.setFlavor( “vanilla” );. Cream. - flavor: String - toppings: String - price: float … . + setFlavor( f: String ): void.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Ice Cream Model' - DoraAna


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ice cream model
Ice Cream Model
  • If( f.equals(“vanilla”) ){ // do something}else if ( f.equals(“chocolate”) ){ // do something else}
  • Cream aCream = new Cream();aCream.setFlavor(“vanilla”);

Cream

- flavor: String

- toppings: String

- price: float

+ setFlavor(f: String): void

Let’s not do this. Have your complier work harder!

slide2
If( f.equals(“vanilla”) ){ // do something}else if ( f.equals(“chocolate”) ){ // do something else}
  • Cream aCream = new Cream();aCream.setFlavor(“vanilla”);

Cream

- flavor: String

- toppings: String

- price: float

+ setFlavor(f: String): void

If( f.equals(Flavor.VANILLA) ){// do something

}

else if( f.equals(Flavor.VANILLA) ){// do something else

}

Cream aCream = new Cream();

aCream.setFlavor(Flavor.VANILLA);

Cream

<<enumeration>>

Flavor

- flavor: Flavor

- toppings: String

- price: float

0..*

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

1

+ setFlavor(f: Flavor): void

slide3

Cream

<<enumeration>>

Flavor

0..*

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

0..*

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

<<enumeration>>

Topping

0..*

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

slide4

Cream

<<enumeration>>

Flavor

0..*

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

Class

diagram

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

myCream: Cream

vanilla: Flavor

Flavor.VANILLA

Object

diagram

yourCream: Cream

chocolate: Flavor

Flavor.CHOCOLATE

: Cream

strawberry: Flavor

Flavor.STRAWBERY

now we can make these ones
Now, We can Make these Ones.

Cream

<<enumeration>>

Flavor

0..*

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

0..*

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

<<enumeration>>

Topping

0..*

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

how about these ones
How about these ones?

http://www.graniteschools.org/jr/eisenhower/images/memorie%20pics/world_records/Tallest_Ice_Cream_Cone.jpg

slide7

up

0..1

Cream

<<enumeration>>

Flavor

0..*

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

down

0..*

0..1

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

Class

diagram

<<enumeration>>

Topping

0..*

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

3rdCream: Cream

vanilla: Flavor

up

Flavor.VANILLA

Object

diagram

down

2ndCream : Cream

chocolate: Flavor

up

Flavor.CHOCOLATE

down

1stCream : Cream

strawberry: Flavor

slide9

1

<<enumeration>>

Flavor

Cream

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

0..*

- scoops

0..*

0..*

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

<<enumeration>>

Topping

0..*

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

- cone

1

0..1

Cone

0..*

how about these cases
How about these cases?

Cone or cup

Size of cone/cup

slide11

<<enumeration>>

Flavor

Cream

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

0..*

- scoops

0..*

0..*

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

<<enumeration>>

Topping

0..*

- scoops

0..*

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

- cup

0..1

0..1

- cone

0..1

0..*

Cup

Cone

0..*

0..*

<<enumeration>>

Size

SMALLMEDIUM

LARGE

1

- size

slide12

<<enumeration>>

Flavor

Cream

1

- flavor: Flavor

- toppings: Topping[]

- price: float

VANILLACHOCOLATESTRAWBERY

LIME

ORANGE

0..*

- scoops

0..*

0..*

+ setFlavor(f: Flavor): void

+ setToppings(t: Topping[]): void

<<enumeration>>

Topping

0..*

1

- base

NUTSEXTRACHOCOLATESTRAWBERRYJEERRY

Base (Lower Part)

0..*

- size: Size

- scoops: Cream[]

- price: float

- topping: Topping

- size

1

0..1

<<enumeration>>

Size

SMALLMEDIUM

LARGE

Cup

Cone

0..*

ad