One thing I like about you is that you try your best to give attention to all the posted comments/questions. Other youtubers just ask audience to like and subscribe.
Thanks for the video. The Undo Operations needs to be clearly explained by Interviewer, as Undo May mean not just Inversion of Last Operations But also Performing the Operation that was prior to current operation. Example : Turn AC on SetTemp Undo So at last Undo might refer to revert of last Operation i.e. set Temp and hence implementation could change as per this.
It will make more sense to accept command as method argument in MyRemoteControl instead of constructor arg otherwise every time I need to execute a method(command) I need to create 2 extra objects ie 1 MyRemoteControl 2. Command.
Very nice video sir ❤ I guess Doubly linked list is more helpful here in case of remote control buttons. Can insert from rear end and remove from front end or rear end only as per requirement. Thanks again !!
@@ConceptandCodingIf possible sir could you please make all structural design patterns in 1 video and all behavioral design patterns in 1 video please ?
Thanks for the great explanation! I have one query If we want to also provide the setTemperature(int temp) to the client, I can think of 2 solutions: 1. Have one more method execute(int temp) in the command interface to support the setTemperature(), but TurnACOffCommand and TurnACOnCommand will have to unnecessarily implement the execute(int temp) method. 2. Have one more command interface which will have execute(int temp) and the SetTemperatureCommand will implement this interface while the existing TurnACOffCommand and TurnACOnCommand will implement the first command method. What should be the ideal solution for this usecase?
Same thought. ChangeTempCommand class ( new one) will also have have undo method, and it would retain Last Temp Values Set, so when undo is called, It can ask AC to Increase or Decrease Temp based on retained temp data.
Will using DLL make more sense in place of stack - as we have no control over size of stack; with DLL we can insert commands from one side and remove commands from the other side ( if undo DLL size grows beyond initial capacity, let’s say we only want to store last 5 commands) ?
target I am setting for myself for this year to complete is your lld+ hld + java + springboot videos with coding practice and complete the head first design pattern and clean code books (2 times minimum)
Hye Shreyansh, I saw your LLD video for vending machine where we are using State design pattern, in that you have mentioned if the system has states we should use state pattern, can't we use the same pattern here? Also can you please upload a video on difference between State vs Strategy vs Command design pattern?
I think text editors are best example where we can use command design pattern, where undo and redo features make sense. Again please correct me if I am wrong as have started learning LLD recently and you are more experienced in this field.
@@vishalmate ohh got it. Yes. Changing the State from On to Off. Make sense, we can also design air conditioner behaviour using state design pattern. And you also try to implement it using state design pattern.
Thanks to you, for all your efforts that you are putting to create all the content. I can imagin how much time and efforts are require to create a single video from preparation, coding, video recording and editing. Thanks again.
Hi there, i am final year undergrad preping for placements , can someone please tell what is expected in design rounds, i mean is it solely focused on LLD or HLD or both (for fresher roles)
sir whats the role of invoker apart from applying undo feature like if we don't want undo feature then client already has reference to command and the receiver so client can directly call commands execute method and still there is no tight coupling between client and receiver plz reply sir
@@ConceptandCoding this example was exactly I was looking for. That undo thing made it clear, I had previous problems in understanding why object is required for command
@@ConceptandCoding if you can make it clear I can imagine a way if decoupling , even when you directly call the execute function from client side , and pass the receiver in it. Is that correct ?