I am confused of the difference between the command pattern and iterator pattern . For me it both looks the same. Can any one please help me in this.
I am confused of the difference between the command pattern and iterator pattern .
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They are fundamentally different.
Are you sure you’ve even looked at an example implementation of each? And used the debugger to step through the examples to learn what they do?
A command is an object which represents an action. It can be created by one part of the program and later be executed by any other part.
An iterator is a means of performing the same action on all elements of a collection.