0
Why object is called factory of object
2 ответов
+ 7
A factory allows to create an object by invoking a getter method that returns an instance of that object. You don't need to explicitly invoke the constructor then. A factory is usually provided as an interface. The factory pattern is commonly used to follow the rules of OOP (encapsulation ).
+ 1
I think I understood what you mean, but could you please post an example?
Just to be sure.