Introduccion
Dónde estamos y hacia dónde vamos
Patrones creacionales
Singleton
Singleton 101
Implementación de Singleton en JS
Contrastemos: Singleton con TS
Singleton: pros y contras
Factory
Factory 101
Diagrama de implementación de Factory
Implementación de Factory en JS
Contrastemos: Factory en TS
Factory: pros y contras
Abstract Factory
Abstract Factory 101
Diagrama de implementación de Abstract Factory
Implementación de Abstract Factory en JS
Contrastemos: Abstract Factory en TS
Abstract Factory: pros y contras
Builder
Builder 101
Diagrama de implementación de Builder
Implementación de Builder en JS
Contrastemos: Builder en TS
Builder: pros y contras
Prototype
Prototype 101
Diagrama de implementación de Prototype
Implementación de Prototype en JS
Contrastemos: Prototype en TS
Prototype: pros y contras
Conclusiones
¿Qué sigue sobre patrones de diseño?
Creative patterns are fundamental in software development. These patterns are used to abstract the process of object creation and instantiation. Their main purpose is to make the creation of new objects more reusable and extensible. Throughout this section, we will discuss five popular authoring patterns: Singleton, Factory, Abstract Factory, Builder, and Prototype. Each of them offers effective ways to handle object creation in different design contexts.
These patterns operate through techniques that facilitate the object creation process, allowing code to be less dependent on concrete classes. By implementing these patterns, developers can create more flexible and scalable systems. The following is a brief summary of the five patterns we will discuss:
Design patterns are not rigid rules; on the contrary, they encourage creativity in their application. For example, although you may initially use a pattern such as Factory, you could innovate by combining it with Singleton to meet specific requirements of your project. The ability to mix and match patterns can result in even more optimized solutions tailored to the particular needs of an application.
Singleton with Factory: Use Singleton to manage the single instance of a Factory that is responsible for creating multiple objects, ensuring that the Factory is managed efficiently from anywhere in the system.
Builder with Prototype: Implement Builder to handle the complexity of creating objects using different configurations, but leverage Prototype to duplicate existing configurations quickly.
Never underestimate the power of imagining new ways to apply these patterns; it is this skill that distinguishes a creative and effective developer - go ahead, experiment and discover new combinations that fit your projects!
Contributions 7
Questions 0
Solo con decir que todo JavaScript está basado en el patrón Prototype… impresiona
Genial que se puedan mezclar entre ellos, para sacarle mucho mas provecho a los patrones
Pongan la informacion de lo que dice en los recursos
Want to see more contributions, questions and answers from the community?