¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Design Pattern

Jonnatas Silva Portugués

Contenido del mapa

Design Pattern

  1. Flyweight

    • Why to use?
      • Reduce memory usage by sharing as much data as possible
    • When to use?
      • The flyweight object’s state is made up of an invariant component shared with other similar objects (intrinsic) and a variant component which can be manipulated by the client code (extrinsic)
    • How to implement?
      • To define an interface
      • To create the concrete classes
      • To create a factory class that will return build the flyweight object
      • It’s very important that the flyweight objects are immutable: any operation on the state must be performed by the factory.
      • The client will use the interface and the factory class to build the flyweight
  2. Proxy

    • Why to use?
      • Surrogate or placeholder a real object expensive to create
    • When to use?
      • Lazy initialization (virtual proxy). This is when you have a heavyweight service object that wastes system resources by being always up, even though you only need it from time to time.
      • Access control (protection proxy). This is when you want only specific clients to be able to use the service object; for instance, when your objects are crucial parts of an operating system and clients are various launched applications (including malicious ones).
      • Local execution of a remote service (remote proxy). This is when the service object is located on a remote server.
      • Logging requests (logging proxy). This is when you want to keep a history of requests to the service object.
      • Caching request results (caching proxy). This is when you need to cache results of client requests and manage the life cycle of this cache, especially if results are quite large.
    • How to implement?
      • Implements the same interface of the real object
      • Wrappes the real object

Información

Descripción
Mapa Mental sobre Design Pattern, creado por Jonnatas Silva el 15/12/2018.
Creado por
Jonnatas Silva
Visitas
1
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?