Simple Factory

Descripción

Fichas sobre Simple Factory, creado por Alex Orpwood el 23/03/2017.
Alex Orpwood
Fichas por Alex Orpwood, actualizado hace más de 1 año
Alex Orpwood
Creado por Alex Orpwood hace alrededor de 7 años
0
0

Resumen del Recurso

Pregunta Respuesta
Real world example Consider, you are building a house and you need doors. It would be a mess if every time you need a door, you put on your carpenter clothes and start making a door in your house. Instead you get it made from a factory.
In plain words Simple factory simply generates an instance for client without exposing any instantiation logic to the client. In object-oriented programming (OOP), a factory is an object for creating other objects – formally a factory is a function or method that returns objects of a varying prototype or class from some method call, which is assumed to be "new".
When to Use? When creating an object is not just a few assignments and involves some logic, it makes sense to put it in a dedicated factory instead of repeating the same code everywhere.
Mostrar resumen completo Ocultar resumen completo

Similar

Design Patterns
Erica Solum
JOOSE2 Design Patterns
Isaac Jordan
Design Patterns
Shankhoneer Chakrovarty
Design Patterns
Alex Orpwood
OO ToolBox
km mk
Dependency Injection & Inversion of Control
Pritesh Patel
Simple Factory
Alex Orpwood
JOOSE2 Design Patterns
Andrew Popp
Design Patterns
Yawen Hou
Design Patterns
Miguel Alcaraz Rivera
Autores y obras de las generación del 98
maya velasquez