Post Redirect Get is a typical web development Design Pattern that solves the problem of sending duplicate post request on page refresh (F5 problem). This problem has been known for many years and there are many solutions, but the simplest and most common one is the Post Redirect Get(PRG) pattern. Not everyone knows that this solution is actually classified as design pattern due to its simplicity.

So as I said the solution is very simple:

...

Singleton Design pattern is one of the simplest and most common patterns that exists. It is part of Creational Design Patterns. Its goal is to ensure that only one instance of an object could be created.

There are many examples for cases where you would need an object to be instantiated only once:

  • Managers - For example a WindowManager
  • Engines - For example Dependency Resolver Engine
  • Factories, Loggers, Configurators and etc.

Null Object Design Pattern is one of the Behavioral Patterns. The Intent of the pattern is to provide an intelligent way to get a analog for a missing object that simply does nothing in the particular scenario. We all know that there are scenarios that depend on the concrete type of the used object. The if statement is not very elegant solution to this problem but the Null Object pattern provides as a simple way...

Flyweight Pattern is one of the Structural Design Patterns. Its goal is to ease the memory consumption when using many objects by extracting the common properties in some kind of pool in the memory, represented by a data structure such as Dictionary, HashMap or another.

Real World Example

Lets say, for example that you are creating a Car Registration System. Everything is fine until you have to dealt with the problem of registering millions...

This is one of the basic Creational patterns and one of the most used one in the software development. It is one of the GoF patterns. Like most design patterns it has multiple different implementations, but in every variant the purpose is to hide the instantiation logic from the client and to get instances of objects through common interface.

Factory Pattern Diagram

So lets think of a scenario in which the Factory...