This repository contains code and UML structure diagrams for various design patterns implemented in Java.
Creational patterns focus on the process of object creation.
Intent: Ensure a class has only one instance, and provide a global point of access to it.
Intent: Define an interface for creating objects, but let subclasses decide which classes to instantiate. Factory Method lets a class defer instantiation to subclasses.
Intent: Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Intent: Separate the construction of a complex object from its representation, allowing the same construction process to create various representations.
Intent: Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Structural patterns focus on the composition of classes and objects.
Intent: Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
Intent: Decouple an abstraction from its implementation so that the two can vary independently.
Intent: Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
Intent: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Intent: Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
Intent: Use sharing to support large numbers of fine-grained objects efficiently.
Intent: Provide a surrogate or placeholder for another object to control access to it.
Behavioral patterns focus on communication between objects and how they operate together.
Intent: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
Intent: Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
Intent: Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
Intent: Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Intent: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Intent: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Intent: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
❤❤💛💛❤❤💛💛❤❤💛💛❤❤💛💛❤❤
Thank You, and Make Sure To Give This Repo a Like and Fork This For Usage. And Dont Forget to Follow Me on Github