Design pattern
Design Pattern: Singleton
17/12/11 18:05 Category: Design Pattern | Software engineering
The singleton is a design pattern used when it is needed to have one and only one object of a certain class.
As the singleton instance can be accessed from anywhere in a system, this design pattern can be used to coordinate actions, or to replace global variables.
As the singleton instance can be accessed from anywhere in a system, this design pattern can be used to coordinate actions, or to replace global variables.
Design Pattern: Factory
07/12/11 21:41 Category: Design Pattern | Software engineering
The Factory is a design pattern used when it is needed to create objets without having to specify the exact class to implement. We only know need to know the general usage of the implemented class, not the internal operations.
That’s why a Factory return objets who are either :
- from a class extending a known abstract class,
- or from a class implementing a known interface.
That’s why a Factory return objets who are either :
- from a class extending a known abstract class,
- or from a class implementing a known interface.