Lesson 7 Flashcards
is one of the simplest design
patterns: it involves only one class which is responsible to
make sure there is no more than one instance; it does it
by instantiating itself and in the same time it provides a
global point of access to that instance
The singleton pattern
are used for centralized management
of internal or external resources and they provide a
global point of access to themselves.
singletons
Ensure that only one instance of a class is created and
Provide a global access point to the object.
should be used when we must
ensure that only one instance of a class is created
and when the instance must be available through
all the code.
A special care should be taken in multi-threading
environments when multiple threads must access
the same resources through the same singleton
object.
SINGLETON
is probably the most used
design pattern in modern programming languages like
Java and C#. It comes in different variants and
implementations.
Defines an interface for creating objects, but let
subclasses to decide which class to instantiate and Refers
to the newly created object through a common
interface.
It creates objects without exposing the instantiation logic
to the client.
efers to the newly created object
through a common interface
FACTORY METHOD
a super-factory which
creates other factories (Factory of factories)
ABSTRACT FACTORY
A pattern that provides an interface for creating families of
related or dependent objects without specifying their concrete
classes.
ABSTRACT FACTORY