SCShreyash Chavhaninstruglingblogs.hashnode.dev·Sep 16, 2023 · 2 min readFascade PatternTask - Build a Home Sweet Home Theater. That's a hell lot of classes and their interactions. Below is the way to watch a movie the hard way. Turn on the popcorn popperpopper.on(); Start the popper poppingpopper.pop(); Dim the lightslights.di...00
SCShreyash Chavhaninstruglingblogs.hashnode.dev·Sep 15, 2023 · 1 min readAdapter PatternWhy Adapter Pattern Solution Class Diagram Object and Class adapter Above class diagram is for object adapter, below is class adapter. Object uses composition, class uses subclassing. Let's take a example of Enumeration and Iterator. Task is to...00
SCShreyash Chavhaninstruglingblogs.hashnode.dev·Sep 4, 2023 · 2 min readCommand PatternTask - We have to design an API for remote control for Home automation. Reference example - a waitress in restaurant. Now we have to place a device in empty slots and press button whichever you want. Let's see what are the vendor devices Now looks...00
SCShreyash Chavhaninstruglingblogs.hashnode.dev·Sep 4, 2023 · 2 min readSingleton PatternWhy Singleton Pattern Singleton pattern also gives us a global point of access, just like global variables, but without initializing the object beforehand, a global variable gets created when your application starts which is a downside. How to rest...00
SCShreyash Chavhaninstruglingblogs.hashnode.dev·Sep 3, 2023 · 2 min readDecorator PatternTask - Design beverage shop with multiple toppings on it. Initially the shop was not offering the toppings only a specific beverage.So design would look like this. So you they have expanded and started offering the toppings as well, in similar way w...00