You are in an icecream parlour where you can choose between 100 flavours and 50 toppings, but usually the clients want a sundae chocolate & vanilla!
So you can do a fast line where you say "the classic" then you obtain your sundae with chocolate and vanilla insted of making the slow line and specify everything detailed.
With code:
IceCreamParlour.theClasic()
vs
i = new IceCream();
i.presentation(SUNDAE)
i.addFlavour(chocolate)
...
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
You are in an icecream parlour where you can choose between 100 flavours and 50 toppings, but usually the clients want a sundae chocolate & vanilla!
So you can do a fast line where you say "the classic" then you obtain your sundae with chocolate and vanilla insted of making the slow line and specify everything detailed.
With code:
IceCreamParlour.theClasic()
vs
i = new IceCream();
i.presentation(SUNDAE)
i.addFlavour(chocolate)
...