MCPcopy
hub / github.com/iluwatar/java-design-patterns

github.com/iluwatar/java-design-patterns @1.25.0 sqlite

repository ↗ · DeepWiki ↗ · release 1.25.0 ↗
5,810 symbols 16,417 edges 1,508 files 2,872 documented · 49%
README

Design patterns implemented in Java

Java CI License MIT Lines of Code Coverage Join the chat at https://gitter.im/iluwatar/java-design-patterns

All Contributors

Read in different language : zh, ko, fr, tr, ar, es, pt, id, ru, de, ja

Introduction

Design patterns are the best formalized practices a programmer can use to solve common problems when designing an application or system.

Design patterns can speed up the development process by providing tested, proven development paradigms.

Reusing design patterns help prevent subtle issues that cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.

Getting started

This site showcases Java Design Patterns. The solutions have been developed by experienced programmers and architects from the open source community. The patterns can be browsed by their high level descriptions or by looking at their source code. The source code examples are well commented and can be thought as programming tutorials on how to implement a specific pattern. We use the most popular battle-proven open source Java technologies.

Before you dive into the material, you should be familiar with various Software Design Principles.

All designs should be as simple as possible. You should start with KISS, YAGNI, and Do The Simplest Thing That Could Possibly Work principles. Complexity and patterns should only be introduced when they are needed for practical extensibility.

Once you are familiar with these concepts you can start drilling down into the available design patterns by any of the following approaches

  • Search for a specific pattern by name. Can't find one? Please report a new pattern here.
  • Using tags such as Performance, Gang of Four or Data access.
  • Using pattern categories, Creational, Behavioral, and others.

Hopefully you find the object oriented solutions presented on this site useful in your architectures and have as much fun learning them as we had developing them.

How to contribute

If you are willing to contribute to the project you will find the relevant information in our developer wiki. We will help you and answer your questions in the Gitter chatroom.

License

This project is licensed under the terms of the MIT license.

Contributors

Ilkka Seppälä 📆 🚧 🖋 Subhrodip Mohanta 💻 👀 🚧 amit1307 💻 Narendra Pathai 💻 🤔 👀 Jeroen Meulemeester 💻 Joseph McCarthy 💻 Thomas 💻
Anurag Agarwal 💻 Markus Moser 🎨 💻 🤔 Sabiq Ihab 💻 Amit Dixit 💻 Piyush Kailash Chaudhari 💻 joshzambales 💻 Kamil Pietruszka 💻
Zafar Khaydarov 💻 📖 Paul Campbell 💻 Argyro Sioziou 💻 TylerMcConville 💻 saksham93 💻 nikhilbarar 💻 Colin But 💻
Ruslan 💻 Juho Kang 💻 Dheeraj Mummareddy 💻 Bernardo Sulzbach 💻 Aleksandar Dudukovic 💻 Yusuf Aytaş 💻 Mihály Kuprivecz 💻
Stanislav Kapinus

Extension points exported contracts — how you extend this code

HasPrice (Interface)
HasPrice trait for static access to 'price' property. [10 implementers]
abstract-document/src/main/java/com/iluwatar/abstractdocument/domain/HasPrice.java
Coin (Interface)
Coin interface. [10 implementers]
factory/src/main/java/com/iluwatar/factory/Coin.java
PriceClient (Interface)
An interface used to communicate with the Price microservice. [9 implementers]
api-gateway/api-gateway-service/src/main/java/com/iluwatar/api/gateway/PriceClient.java
Builder (Interface)
Functional interface that allows adding builder with name to the factory. [14 implementers]
factory-kit/src/main/java/com/iluwatar/factorykit/Builder.java
Event (Interface)
A Event is an object with a specific type that is associated to a specific Handler. [7 implementers]
event-driven-architecture/src/main/java/com/iluwatar/eda/framework/Event.java
DragonSlayingStrategy (Interface)
Strategy interface. [29 implementers]
strategy/src/main/java/com/iluwatar/strategy/DragonSlayingStrategy.java
Army (Interface)
Army interface. [10 implementers]
abstract-factory/src/main/java/com/iluwatar/abstractfactory/Army.java
PersonRepository (Interface)
Person repository. [6 implementers]
repository/src/main/java/com/iluwatar/repository/PersonRepository.java

Core symbols most depended-on inside this repo

get
called by 325
property/src/main/java/com/iluwatar/property/Prototype.java
of
called by 170
monad/src/main/java/com/iluwatar/monad/Validator.java
add
called by 163
dao/src/main/java/com/iluwatar/dao/CustomerDao.java
equals
called by 120
hexagonal/src/main/java/com/iluwatar/hexagonal/domain/LotteryTicket.java
put
called by 113
abstract-document/src/main/java/com/iluwatar/abstractdocument/Document.java
forEach
called by 98
fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/simple/SimpleFluentIterable.java
start
called by 74
throttling/src/main/java/com/iluwatar/throttling/timer/Throttler.java
map
called by 71
fluentinterface/src/main/java/com/iluwatar/fluentinterface/fluentiterable/FluentIterable.java

Shape

Method 4,202
Class 1,392
Interface 149
Enum 67

Languages

Java100%

Modules by API surface

data-transfer-object/src/main/java/com/iluwatar/datatransfer/product/ProductDto.java40 symbols
step-builder/src/main/java/com/iluwatar/stepbuilder/CharacterStepBuilder.java32 symbols
saga/src/main/java/com/iluwatar/saga/choreography/Saga.java26 symbols
transaction-script/src/test/java/com/iluwatar/transactionscript/HotelDaoImplTest.java24 symbols
dao/src/test/java/com/iluwatar/dao/DbCustomerDaoTest.java24 symbols
saga/src/test/java/com/iluwatar/saga/orchestration/SagaOrchestratorInternallyTest.java20 symbols
table-module/src/test/java/com/iluwatar/tablemodule/UserTest.java19 symbols
priority-queue/src/main/java/com/iluwatar/priority/queue/PriorityMessageQueue.java19 symbols
commander/src/main/java/com/iluwatar/commander/Commander.java19 symbols
special-case/src/main/java/com/iluwatar/specialcase/Db.java18 symbols
reader-writer-lock/src/main/java/com/iluwatar/reader/writer/lock/ReaderWriterLock.java18 symbols
reactor/src/main/java/com/iluwatar/reactor/framework/NioReactor.java17 symbols

Dependencies from manifests, versioned

${project.groupId}:naked-objects-dom1.25.0 · 1×
${project.groupId}:naked-objects-fixture1.25.0 · 1×
${project.groupId}:naked-objects-webapp1.25.0 · 1×
ch.qos.logback:logback-classic
ch.qos.logback:logback-core
com.amazonaws:aws-java-sdk-dynamodb
com.amazonaws:aws-lambda-java-core
com.amazonaws:aws-lambda-java-events
com.fasterxml.jackson.core:jackson-annotations
com.fasterxml.jackson.core:jackson-core
com.github.stefanbirkner:system-lambda

Datastores touched

isisDatabase · 1 repos

For agents

$ claude mcp add java-design-patterns \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact