Deck the halls — The Design Pattern

Sameeha Rahman
5 min readJul 13, 2019

I’m gonna give you a small scenario.

Say you own a coffee shop, and like any newbie, start out with just two types of plain coffee, the house blend, and dark roast. In your billing system, there was one class for the different coffee blends, which inherits the beverage abstract class. People actually start to come by and have your wonderful (albeit bitter😖) coffee. Then there are the coffee newbs that, God forbid, want sugar or milk. Such travesty to coffee!! 😱😱

Now you need to have those two add-ons as well, both to the menu, and…

--

--

Sameeha Rahman

Front End Developer at Switchd Ltd. | MSc in Computer Science @ QMUL (2022)