Entries Tagged ‘singleton’

Design patterns – Part 4: Factory method pattern

Factory method pattern definition: The Factory method pattern defines an interface for creating and objects, but lets subclasses to decide which class they will create. Huh? I will try to present this pattern on a simple example. Imagine you work in a company that sales software. However, this software is, due to different laws, different […]

Design patterns – Part 3: Singleton pattern

The simplest way to describe singleton class is to look at the definition: The Singleton Pattern ensures a class has only one instance, and provides a point of access to it. So why would you need that? Well, there are many objects you only need one of in your application (e.g. Logging, text trimming, for […]