I'm learning about the factory method pattern and its wikipedia page has the following diagram:
http://pl.wikipedia.org/wiki/Plik:Factory_Method_UML_class_diagram.svg
It's pretty simple so I understand everything except one thing - what is that mysterious anOperation()
method? What does it do? More importantly - is it part of the pattern?
Tracking down the Wiki page that uses that figure, you'll find the Google translation from Japanese as follows:
I can't think of a real-world example of factory method that actually does this, however. The Java iterator() method in Collections is a factory method that does not use anOperation() as some intermediate step. I don't see anOperation as a fundamental part of that pattern.