Skip to content

Java implementations of common design patterns with bad vs good examples, explanations, and interview-focused notes.

Notifications You must be signed in to change notification settings

MahimaBharati/design-patterns-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Design Patterns in Java πŸš€

This repository contains examples of commonly used Design Patterns implemented in Java. Each pattern is explained with:

  • ❌ Bad Example (what not to do)
  • βœ… Good Example (proper usage of the pattern)
  • πŸ“– Explanation (definition + how to easily remember it)

πŸ“Œ What are Design Patterns?

Design patterns are proven solutions to common software design problems. They provide a template for writing flexible, reusable, and maintainable code.

Think of them as blueprints for solving recurring problems in software engineering.


⚑ How to Run

  1. Clone the repo:

    git clone https://github.com/your-username/design-patterns-java.git
    cd design-patterns-java
  2. Compile and run any pattern:

    javac pattern/factory/*.java
    java pattern.factory.Main

🎯 Why This Repo?

  • πŸ“‚ Clean separation of patterns (one folder per pattern)
  • ❌ Showcasing bad practices for learning
  • βœ… Demonstrating best practices
  • πŸŽ“ Helpful for interviews and real-world projects

πŸ‘©β€πŸ’» Created for learning, interviews, and reference. Contributions welcome!

About

Java implementations of common design patterns with bad vs good examples, explanations, and interview-focused notes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages