Prototype Design Pattern

Prototype Design Pattern: This pattern is used when objects or instances are created by cloning other object or instances. It allows to add any sub class instance of known super class instance. It is used when there are numerous potential classes , that are ready to use when needed.

It falls under creational design pattern. Continue reading “Prototype Design Pattern”

Singleton Pattern

Singleton Pattern: This pattern is used you want to eliminate the option of instantiating more than one object. It means one and only one instance of the class can be instantiated.

In other words, Singleton pattern is used when, A single instance of a class is required in the application and the class itself is able to enforce the single instance on itself. The rest of the system need not worry about managing the single instance. Continue reading “Singleton Pattern”

Design Patterns and Gang of Four

Design Pattern: As the name suggests, design patterns are set of patterns used in software design, which provide solution to a commonly occurring problem. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

In other words, Design patterns are structured approach to computer programming and its architecture.

Patterns are about reusable designs and interactions of objects.

Gang of Four: The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral (for a complete list see below). Continue reading “Design Patterns and Gang of Four”