Skip to content

ImCoderz/design-pattern-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Design Patterns Repository

Welcome to the Java Design Patterns Repository! 🚀 This repository showcases various design patterns implemented in Java. As a student, I've worked on implementing these patterns to gain a better understanding of software design principles.

Table of Contents

Introduction

Understanding design patterns is a crucial aspect of software development. This repository serves as a learning resource for fellow students and developers interested in Java and design patterns. Each pattern implementation includes detailed explanations, UML diagrams, and code snippets.

Patterns Included

Creational Patterns

  1. Abstract Factory Pattern:

    • Illustrates the implementation of an abstract factory for creating themed GUI elements.
  2. Builder Pattern:

    • Demonstrates the builder pattern in a burger-building scenario.
  3. Factory Pattern:

    • Includes examples with Coffee and Vehicle factories.
  4. Object Pool Pattern:

    • Presents an example of an object pool in a database context.
  5. Optimized Singleton Pattern:

    • Provides two optimized implementations of the Singleton pattern.
  6. Prototype Pattern:

    • Showcases the prototype pattern for creating graphic elements.

Behavioral Patterns

  1. Chain of Responsibility Pattern:

    • Demonstrates the chain of responsibility with an example involving request handling.
  2. Command Pattern:

    • Shows the command pattern in a scenario involving command objects.
  3. Iterator Pattern:

    • Illustrates the iterator pattern with an example of iterating over a collection.
  4. Mediator Pattern:

    • Presents the mediator pattern in a scenario involving communication between components.
  5. Memento Pattern:

    • Provides an example of the memento pattern for saving and restoring an object's state.
  6. Observer Pattern:

    • Demonstrates the observer pattern with an example of a fitness app tracking workouts.
  7. State Pattern:

    • Illustrates the state pattern in a vending machine scenario.
  8. Strategy Pattern:

    • Shows the strategy pattern in a fitness app scenario, allowing users to choose workout strategies.
  9. Template Method Pattern:

    • Provides an example of the template method pattern with a sandwich-making scenario.
  10. Visitor Pattern:

    • Demonstrates the visitor pattern with an example of calculating areas of different geometric shapes.

Feel free to explore each pattern's example code and accompanying explanations to gain a deeper understanding of design patterns and their practical applications.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages