Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

0 Días
3 Hrs
57 Min
21 Seg

Patrones creacionales

2/27
Resources
Transcript

What are creative patterns?

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.

How do creative design patterns work?

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:

  • Singleton: Ensures that a class has only one instance and provides a global access point to this instance.
  • Factory: Defines an interface to create objects in a main class, but allows subclasses to alter the type of objects that are created.
  • Abstract Factory: Provides an interface to create families of related or dependent objects without specifying their concrete classes.
  • Builder: Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
  • Prototype: Allows you to create new objects by copying an existing prototype, which is useful to avoid creating new instances from scratch repeatedly.

How to employ creativity with design patterns?

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.

Examples of creative blends

  1. 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.

  2. 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

Sort by:

Want to see more contributions, questions and answers from the community?

Mas cursos de patrones de diseño de software por favor platzi.

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

# **Patrones creacionales** Abstraen el proceso de creación/instanciación de objectos: 1 - Singlenton. 2 - Factory. 3 - Abstract factory. 4 - Builder. 5 - Prototype.
Estoy viendo estos cursos mientras leo el libro que nos mencionó el profesor Daniel de Desing Patters By Erich Gamma, Richard Helm, Ralph Johnson, John M. Así que voy a ir viendo las clases a medida que avanzo en el libro.

Pongan la informacion de lo que dice en los recursos

**Patrones creacionales** Abstraen el proceso de creación/instanciación de objetos: 1. Singleton 2. Factory 3. Abastract factory 4. Builder 5. Prototype