Jul. 5th, 2022

juan_gandhi: (Default)
Index:
AbstractFactory
Adapter
Action
Behavioral
Bridge
Builder
Chain of Responsibility
Command
Composite
Creational
Cursor
Decorator
Dependents
Facade
Factory Method
Flyweight
Handle/Body
Interpreter
Iterator
Kit
Mediator
Memento
Objects for States
Observer
Prototype
Proxy
Publish/Subscribe
Singleton
State
Structural
Surrogate
Template
Token
Transaction
Virtual Constructor
Visitor
Wrapper




Creational

AbstractFactory aka Kit   Instantiates a class that is determined at runtime
FactoryMethod aka Virtual Constructor   Lets subclasses do object creation: constructor does not help if you do not know the concrete class
Builder   A class that is called to build another class, e.g. document with SAX
Prototype   "Prototypical instance" that is used to make new objects by copying
Singleton   Ensures having one instance per class; get, find, or create returns the same object; constructor is private


Structural

Adapter aka Wrapper   Converts one interface to another
Bridge aka Handle/Body   Separates multiiple implementations; cf. abstract factory + adapter
Composite   Represents "part-whole" hierarchy
Decorator aka Wrapper   Adds functionality to an existing class
Facade   Unified interface to a set of interfaces; provides simple inteface to complex subsystems; decouples subsystems from clients; use for layering
Flyweight   Use it for sharing to support large numbers of objects
Proxy aka Surrogate   Use to control access to another object


Behavioral

Chain of Responsibility   Decouples sender from receiver; use when the actual request handler may not be know in advance
Command aka Action, Transaction   Encapsulates request arguments as an object; good for parameterized actions, undo, queue requests, logging, transactions
Interpreter   Intereprets a language
Iterator aka Cursor   Provides sequential access to elements of an aggregate object
Mediator   Redirects messages, like a PBX. Use it when a distributed behavior should be customizable without subclassing
Memento aka Token   A snapshot of a state; good for undo and when a direct interface for object state whould break encapsulation
Observer aka Dependent, Publish/Subscribe   Good when a change in one object requires changes in others, which need to be notified
State aka Objects for States   Encapsulates changing behavior to avoid switch; use when behavior depends on states, e.g. with large, multipart conditionals



This card is based on Design Patterns by
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides.

I had this stuff in myjavatools.com, the site that I closed several years ago.
juan_gandhi: (Default)
Смотрю абсолютно дебильный фильм, где мужик, хайтешник, из Южной Калифорнии, внезапно подхватился и поехал жить в York County, SC - где и я живу. Люди местные там изображены довольно правдоподобно; все ж остальное бред, вплоть до компактного источника вечной энергии и где-то прячущихся в лесу в нашем каунти пришельцев из космоса. И, конечно, происков large energy corporations. 

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
2425 26272829 30
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 1st, 2025 10:13 am
Powered by Dreamwidth Studios