So ive been looking at several videos, read some information on the internet about this design pattern but just to make things clear is it correct that this pattern is:
an Object (Subject) that has its own implementation of the Iterator interface
And nothing else? no fancy stuff like the observer pattern or decorator pattern or anything like that? It is simply just an implementation of an already known interface?!
Short Answer
Yes, implementing the interface is all there is to it.
Long Answer
Saying “only implementing an interface” is like having an idea for a movie and then “only creating the movie”.
Your interface is nothing more than a spec; it doesn’t do any work, it just defines a signature. The vast majority of your work is done when you implement the interface — ie: WRITE the code.
Please don’t let the words “implement an interface” fool you. It can be simple, or intractably complex.
To give you an idea, take this example. I have an interface for a class that can take your height and weight and from that alone predict the name of your future wife. It’s amazing, isn’t it? Here’s the interface:
Now to make this work, you ONLY need to implement the interface. Please let me know when you have it done; I’d like to know the name of the future Mrs. Barzell 😀