GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Design Pattern

Jonnatas Silva Portugiesisch

Inhalt der Mindmap

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

Informationen

Beschreibung
Mindmap am Design Pattern, erstellt von Jonnatas Silva am 15/12/2018.
Erstellt von
Jonnatas Silva
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck