iluwatar/java-design-patterns
Learning ResourcesA curated collection of Java design pattern implementations with commented source examples for developers and learners.
What this is
Java Design Patterns is a long-running open-source catalog of software design patterns implemented in Java. Each pattern comes with an explanation and a commented code example, so it can be read as a tutorial on how a pattern works and where it fits. The material is aimed at Java developers, students and architects who want a reference implementation rather than a library to add as a dependency.
Patterns can be explored by name, by category such as Creational or Behavioral, or by tags like Performance and Gang of Four. The book-length version is also sold as an e-book, and contributors can request it for free The Book.
Getting started
The hosted site is the fastest way to browse; no installation is required. Before reading pattern pages, go through the software design principles, since the project frames patterns as solutions to be applied only when practically needed.
From there, open the pattern catalog. You can search a pattern by name, filter by tags or category, and open the source example on GitHub. To read in Chinese, use the zh README.
If you want to run or modify examples locally, clone the repository and use the Java build setup in the repository. The README does not spell out a complete clone-build-run command for every example, so the exact Maven invocation depends on the module you target; the source examples and their comments are the intended reference.
Constraints and scope
Examples assume familiarity with Java and object-oriented design; the README explicitly recommends understanding general design principles first. The project is a teaching and reference resource, not a production library, and its examples use popular open-source Java technologies rather than a fixed runtime dependency. The repository is licensed under MIT, but pattern texts and the paid e-book are separate from the code license License.
HotRepo's take
The repository has 94,877 stars and 27,342 forks, with 12 stars gained in the Java daily snapshot dated 2026-11-17, where it reached its best recorded daily position of #8 in the Java list; HotRepo has no all-language daily rank recorded for it. The 2017 Hacker News discussion drew 84 points and 27 comments, and the most substantive thread warned against over-applying patterns HN discussion: one commenter argued that KISS and YAGNI belong at the top of the introduction because Java and C# codebases are often over-patterned comment, while another said patterns should emerge as the code grows rather than be chosen up front comment. That is a useful lens for using the catalog: treat it as a reference for recognizing patterns, not a checklist to impose on every design.
Written by AI from the project's README, updated . The project's own docs are the source of truth.
Hacker News
You might also like
- TheAlgorithms/JavaA read-and-edit Java codebase of classic algorithms for learners and people practicing open-source contributions.
- ddd-by-examples/libraryA Java library example that shows how to apply Domain-Driven Design from Event Storming to a working Spring Boot app.
- ashishps1/awesome-low-level-designA curated index of low-level design tutorials, design patterns, UML, concurrency notes, and interview problems for developers preparing for system design interviews.
- TheAlgorithms/PythonPython implementations of classic algorithms and data structures, intended as a reading and study resource for learners.
- kunal-kushwaha/DSA-Bootcamp-JavaJava data structures, algorithms and interview-prep course materials, including lectures, code samples and assignments, for self-taught learners.