Singleton
In C++, a singleton is used to return control to the programmer by isolating the unpredictability of the order of
dynamic initialization. A singleton pattern is a class that restricts the instantiation of a class to one object. It's commonly used instead of using a globally defined object. There are many uses for singletons like if your game requires a single renderer or a single keyboard is needed.
Facade
A facade is an object that provides a simpler version of a large amount of code like a class library. It is used when one wants an easier interface to an underlying implementation object. It links a lot of related classes which are usually sets of singletons. Facades make communication between subsystems much easier because only one class exchanges data with another class that is within a subsystem which contains interactive classes.
State
State patterns use objects to represent logical states. They can be used for A.I. state switching in behavioural control. The best example would be in the game Pac-man. The A.I. ghosts have different states like, flee or chase depending on what the player does. It allows for easy addition of classes to already existing systems without having to modify too much code. It helps get rid of switch statements. Below is an easy to understand graphic of how the states belong to a system and how it might work.
Factory
A factory is a place where all instances of all types of objects are created. It acts similar to a factory in real life that manufactures objects in the same way. Once the objects have been created, they are shipped off. The same thing is with a factory pattern (as seen below in the figure), it creates many
objects for specific function. The factory pattern is a powerful tool for extensibility and its also good for
organizing memory allocation.
In conclusion, design patterns are a very good practice to use in object oriented programming. They help make code tidy and neat. These type of patterns will help improve programming styles and get you prepared for a professional coding environment.