Thanks so much !! i'm asked same example in interview and i answered got selected....
@onatkorucu8424 жыл бұрын
1. You might be unable to change PilotPen(3rd party library case or an old class that is used by other teams etc.) 2. You want to use dependency injection. So when the available Pen type changes for some reason, you won't have to change AssignmentWork class. Also see open-closed principle. 3. AssignmentWork won't depend on PilotPen this way, so you can remove it from your project easily. 4. If PilotPen gets changed, you will only need to change PilotPenAdapter class.
@lakshyaagarwal40445 жыл бұрын
Man, you are lifesaver
@abishekraju45213 жыл бұрын
Holy crap. This must be the best explanation on this topic I've ever seen. I had like a mini eureka moment at the climax of the video, esp. during the pilot pen part. SUBSCRiBED.
@AshokYadav-np5tn5 жыл бұрын
i like this real world example of pen, assignment . thanks for this video .
@harshgupta1592 жыл бұрын
So we’ll explained, please create videos for other design patterns too!!
@vishaldindalkop2943 ай бұрын
Thank you for the video
@zilaxion4 жыл бұрын
Am I the only one who hears "welcome back idiots" at the beginning? 00:00
@lamiaa47574 жыл бұрын
😂😂😂😂😂😂😂😂
@ipranavprashant10 ай бұрын
😂😂
@eknathtake49205 жыл бұрын
Thanks for this tutorial. This is the best tutorial I've got on youtube. It explains very important and tough design pattern in easy steps.
@sukritakhauri648 Жыл бұрын
great explanation, just wao
@meelmeel1236 жыл бұрын
thanks for saving me for my exam!
@DagestanShop4 жыл бұрын
but cant we just initiliaze Pilot pen writeAssigment method ??
@mixolt233 жыл бұрын
So you could also say it maps methods with different signatures that provide the same logic onto each other?
@atultripathi91663 жыл бұрын
Nice explanation
@Plays-wi1yx4 жыл бұрын
Was this video for adapters ?
@mishrajitendra01115 жыл бұрын
Can we make a standard or generic adapter pattern interface for multiple use case.
@sairawadwa37746 жыл бұрын
I don't get the proper concept like how I would able to use in realtime.sir could you please explain using another example
@meena72223 жыл бұрын
Great example
@harshverm7763 жыл бұрын
Sir, can you share the Repo of all this.... Design Pattern Lectures...
@TysonGill3 жыл бұрын
nicely explained
@wBacz7 жыл бұрын
I don't understand why just simply not use PilotPen in class Assignment Work instead of using Pen interface in class Assingment Work? Or why just not make and interface with default method write and let class PilotPen implement it and AssigmentWork implement it too.
@mallinani1086 жыл бұрын
Let's say PilotPen is implemented in 3rd party library and you don't have access to implement the Pen interface. And one more thing in future some other library or project will provide another type of implementation which is also hasn't implemented pen then adapter pattern will be useful to supply your implementation without worry about implementer. Real time example will be slf4j library if you supply Log4j implementation it uses that, or else you can simply change the logging to logback without changing the code.
@onatkorucu8424 жыл бұрын
1. You might be unable to change PilotPen(3rd party library case or an old class that is used by other teams etc.) 2. You want to use dependency injection. So when the available Pen type changes for some reason, you won't have to change AssignmentWork class. Also see open-closed principle. 3. AssignmentWork won't depend on PilotPen this way, so you can remove it from your project easily. 4. If PilotPen gets changed, you will only need to change PilotPenAdapter class.
@LuaneCarolineAquinoCavalcanti7 жыл бұрын
Thank you so much!
@RaushanKumar-co3wj8 жыл бұрын
i am searching for all design pattern tutorial from you. If you can you give me the link?
@nincako8 жыл бұрын
why don't you make PilotPen implements Pen instead?
@gijish4u8 жыл бұрын
To not change the implementation of PilotPen I suppose. Adapter helps to use both Pen and PilotPen as it is.
@soho10808 жыл бұрын
Something seems to be missing here. Where is the original concrete implementation of Pen that the PilotPen needs to adapt to??!!
@AkashGupta-mz5edАй бұрын
What is director here??
@hasnahoque28177 жыл бұрын
So helpful
@gauravupasani90882 жыл бұрын
The explanation is good however what I don't understand is why do we need a Pen Adapator itself. In the hardware world it makes sense that you repurpose the same charger. Thus you don't have to buy a new one. But why in the software world why not just directly use the pen instead of relying on this adapter thing ?
@pavankumar-si2jv4 жыл бұрын
Awesome
@mrchedda3 жыл бұрын
am I crazy or is this just sub-class with an override method? Why not just explain it that way?