1/68
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Creational Design Patterns
This type of patterns support the creation of objects.
Abstract Factory
This creational design pattern provides an interface for creating families of related or dependent objects without the need to specify their concrete classes.
Factory Method
This creational design pattern defines an interface for object creation but lets the subclass decide which object to create.
Builder
This creational design pattern enables a more readable object creation and lets you specify the fields that are actually needed.
Prototype
This creational design pattern helps if objects are expensive to create and new objects will be similar to existing objects.
Clone
The prototype design pattern uses this method to duplicate existing instances to be used as a prototype for new instances.
Singleton
A This creational design pattern ensures that only one instance of an object is created and that this instance is globally accessible.
Logging
Logging is one meaningful example for the Singleton as the information flow happens only in one direction and therefore global state is not a big issue.
Structural Design Patterns
These type of pattern helps to design relationships between objects
Adapter
This structural design pattern works between two independent or incompatibale interfaces
Bridge Pattern
This structural design pattern is used to decouple interfaces from implementations, if there are hierarchies in interfaces as well as implementations.
Composite Pattern
A design pattern that allows you to compose objects into tree structures to represent part-whole hierarchies.
Decorator Pattern
A design pattern that allows behavior to be added to individual objects, either statically or dynamically, without affecting the behavior of other objects from the same class.
Facade Pattern
A design pattern that provides a simplified interface to a complex subsystem.
Flyweight Pattern
A design pattern that minimizes memory usage by sharing as much data as possible with similar objects.
Proxy Pattern
A design pattern that provides a surrogate or placeholder for another object to control access to it.
Chain of Responsibility
A design pattern that allows an object to send a command without knowing which object will receive and handle it.
Command
A design pattern that encapsulates a request as an object, thereby allowing for parameterization of clients with queues, requests, and operations.
Interpreter
A design pattern that defines a representation for a language's grammar along with an interpreter that uses the representation to interpret sentences in the language.
Iterator
A design pattern that provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Mediator
A design pattern that defines an object that encapsulates how a set of objects interact.
Observer
A design pattern that defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Strategy
A design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable.
Template
A design pattern that defines the skeleton of an algorithm in a method, deferring some steps to subclasses.
Visitor
A design pattern that lets you separate algorithms from the objects on which they operate.
Null Object
A design pattern that uses a special object to represent a null reference.
State
A design pattern that allows an object to alter its behavior when its internal state changes.
Memento
A design pattern that allows for the capture and externalization of an object's internal state so that the object can be restored to this state later.
Singleton
The private constructor in the example ensures that the object creation only happens through getInstance() which at the same time serves as the global accessor.
Structural Design Patterns
These type of pattern helps to design relationships between objects.
Adapter
The Adapter Pattern works between two independent or incompatible interfaces.
Bridge
This structural design pattern is used to decouple interfaces from implementations, if there are hierarchies in interfaces as well as implementations.
Composite
This structural design pattern allows to treat a group of objects the same way as a single object.
Composite Example
This structural design pattern is for example used in tree-like object structures where a parent node's operation influences or is dependent on child nodes.
Decorator
This structural design pattern allows to add functionality to an object at run-time without altering its structure.
Facade
This structural design pattern provides a simplified interface to a complex subsystem of classes, making it easier to use.
Flyweight
This structural design pattern is applied if lots of objects from one class need to be constructed. Objects are shared to reduce the memory load
Proxy
This structural design pattern acts as a substitute or placeholder for another object to control access to it.
Serialization
This is the interface that allows you to serialize a class.
Transient
This is the keyword used so you don't include this field in serialization.
True
True or False
You can no longer deserialize the object when you modify the method's name in the serialized class.
False
True or False
You can no longer deserialize the object when you modify the method's body in the serialized class.
readObject
What method of ObjectOutputStream is used to deserialize an object?
Facade
This Structural Pattern is used to harmonize different interfaces for the main interface to seem simple.
Prototype
This Creational Pattern helps if objects are expensive to create and new objects will be similar to existing objects.
Decorator
This Structural Pattern allows to add functionality to an object at run-time without altering its structure.
Flyweight
This Structural Pattern is applied if lots of objects from one class need to be constructed where objects are shared.
Builder
This Creational Pattern enables a more readable object creation and lets you specify the fields that are actually needed.
Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Observer, Strategy, Template, Visitor, Null Object, State, Memento
Name 12 behavioral design patterns
Chain of Responsibility
A way of passing a request between a chain of objects.
Chain of Responsibility
This Behavioral Design Pattern allows an object to send a command without knowing what object will receive and handle it.
Command
This Behavioral Design Pattern encapsulate a command request as an object, allowing requests to be issued without knowing the requested operation or the requesting object.
Interpreter
This Behavioral Design Pattern is a way to include language elements in a program by defining a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
Interpreter
Maps a domain to a language, the language to a grammar, and the grammar to a hierarchical object-oriented design.
Interpreter Implementation
This Behavioral Design Pattern is just the use of the composite pattern applied to represent a grammar.
Iterator
This Behavioral Design Pattern is used to sequentially access the elements of a collection, which is just a grouping of some objects.
Mediator
This Behavioral Design Pattern defines simplified communication between classes.
Observer
This Behavioral Design Pattern is a way of notifying change to a number of classes.
one-to-many
Obsever defines what cardinality dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Strategy
This Behavioral Design Pattern encapsulates an algorithm inside a class.
Template Method
This Behavioral Design Pattern defer the exact steps of an algorithm to a subclass. This is a preset format, used as a starting point for a particular application so that the format does not have to be recreated each time it is used.
Template
This Behavioral Design Pattern defines an algorithm in a base class using abstract operations that subclasses override to provide concrete behavior.
Visitor
This Behavioral Design Pattern defines a new operation to a class without change.
Visitor
This Behavioral Design Pattern has an interface used to declare the visit operations for all the types of visitable classes.
Null Object
This Behavioral Design Pattern is designed to act as a default value of an object, used when a system may or may not need to use certain functionalities.
State
This Behavioral Design Pattern alters an object's behavior when its state changes, allowing the object to appear to change its class.
Memento
This Behavioral Design Pattern captures and restores an object's internal state, useful in case of error or failure.
Originator
Creates a memento object capturing its internal state and uses the memento object to restore its previous state.
Caretaker
Responsible for keeping the memento, which is opaque to the caretaker, preventing any operations on it.