Factories are objects that encapsulate the logic for creating other objects.
Factory object could create one or another object based on some configuration parameters. Or the factory could decide what kind of concrete object to create based on a parameter to some object creational method. For example if the method received post-code the factory creates City object and when the parameter is an email address the factory creates Customer object. In that way one might create factory to select one or anoth...
No comments yet, be the first one to post comment.