I was comparing this design pattern over the internet and by far your explanation has been the best with nice visual diagrams. ore power to you brother!
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.
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) ?
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.
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 ?
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
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)
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.
@@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 ?
I was comparing this design pattern over the internet and by far your explanation has been the best with nice visual diagrams. ore power to you brother!
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.
LLD and HLD is soo interesting because of you 🙃 .Happy Coding
Thanks
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.
For undo redo, isnt memento pattern more suitable?
I love LLD more than HLD, Keep LLD coming
Sure
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) ?
Make sense
@ConceptandCoding why facade cant be used here ,? is also undergo similar purpose , please explain
Best Explanation !!!
Thanks for great content .Appreciate your efforst👍👍🙏
Thanks
Great explanation 🎉
Thank you
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.
Great work ❤
Thanks
Great work👍👍👍
Thank you
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 !!
Yes buddy make sense
@@ConceptandCodingIf possible sir could you please make all structural design patterns in 1 video and all behavioral design patterns in 1 video please ?
@@tejasshaha6629 yes it's in my bucket list
@@ConceptandCoding Thank you sir
Thanks for the video.
Thanks
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
ack of the question
Why command pattern does not return as gof ?
Awesome ❤
Thanks
Are you still adding videos to this playlist?
or this will be till here only?
adding more buddy
thanks for resuming the lld series
:)
what about set temparature command, or where user input is needed.
how to handle these commnads ?
Appropriate datastructure can be used, to store the object
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)
HLD is not that much imp, but LLD is
Note not there give link not working 😢
Let me check tonight buddy, i will update the link.
Thanks for updating me.
@@ConceptandCoding Sir, still have't uploaded yet
pls check now, i have updated the description section: notebook.zohopublic.in/public/notes/u3i1s7022b343ebda42819272312415abb520
@@ConceptandCoding Huge thx
The notebook URL from the description is not working.
Let me check buddy
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)
good luck piyush
Recently you have changed the notepad . Which is this android or iPad . Looks nice. Please suggest me . I want to use for note taking.
For notes, you can use Zoho notebook, else Microsoft OneNote
@@ConceptandCoding i was asking about the pad you are using in videos for writing. Please can you suggest
@@swapnajitpanda5841 pls check the first video of this channel.
I am using wacom pad
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?
Why you think state and command pattern are same?
Pls elaborate more Vishal
Since you have used it to design air-conditioning system, ideally we should use state design here, correct me if I am wrong.
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.
Notes Link Not Working
Will check and update buddy
17:54 client still has to know about all the commads it can perform
i do not think this pattern makes any sense
or maybe the example is not good
I guess it can be done by facade design pattern as it provides a simple interface to the client
Same but one is behaviour pattern and another is structural. So even though their solution looks same but the intention is different
@@ConceptandCoding so whats the actual difffernce between behavioiral and structural and when to use one
try to tell beforehand what you are actually building so we can check what is wrong with the given solution at an early stage.
Sure buddy
This is similar like strategy design pattern
I agree. Different strategy to implement different command
Bhai keerthi ko bolo course mein ye example daaldein
?
@@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
@@tanmaiysethia176 glad to know that:)
@@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 ?
Command Pattern is the stupidest design pattern i have seen so far.