Fascade 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...2 min read·struglingblogs.hashnode.devSep 16, 2023
Adapter 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...1 min read·struglingblogs.hashnode.devSep 15, 2023
Command 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...2 min read·struglingblogs.hashnode.devSep 4, 2023
Singleton 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...2 min read·struglingblogs.hashnode.devSep 4, 2023
Decorator 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...2 min read·struglingblogs.hashnode.devSep 3, 2023