iluwatar/java-design-patterns

Explanation for design patterns

iluwatar opened this issue ยท 40 comments

We want to present the design patterns better as the current does not reach its goal of explaining how the pattern works in a simplest possible way. I'm hugely inspired by https://github.com/kamranahmedse/design-patterns-for-humans repository.

Let's do this by adding 'Explanation' section to the patterns' README.md file. For an example see http://java-design-patterns.com/patterns/bridge/.

Let's track the issue progress here with the following checklist that indicates the patterns where explanation section is already available.

  • abstract-document
  • abstract-factory
  • active-object
  • acyclic-visitor
  • adapter
  • aggregator-microservices
  • ambassador
  • api-gateway
  • arrange-act-assert
  • async-method-invocation
  • balking
  • bridge
  • builder
  • business-delegate
  • bytecode
  • caching
  • callback
  • chain
  • circuit-breaker
  • cloud-static-content-hosting
  • collection-pipeline
  • combinator
  • command
  • commander
  • composite
  • composite-entity
  • converter
  • cqrs
  • dao
  • data-bus
  • data-locality
  • data-mapper
  • data-transfer-object
  • decorator
  • delegation
  • dependency-injection
  • dirty-flag
  • double-buffer
  • double-checked-locking
  • double-dispatch
  • eip-aggregator
  • eip-message-channel
  • eip-publish-subscribe
  • eip-splitter
  • eip-wire-tap
  • event-aggregator
  • event-based-asynchronous
  • event-driven-architecture
  • event-queue
  • event-sourcing
  • execute-around
  • extension-objects
  • facade
  • factory
  • factory-kit
  • factory-method
  • fan-out-fan-in
  • feature-toggle
  • filterer
  • fluentinterface
  • flux
  • flyweight
  • front-controller
  • game-loop
  • guarded-suspension
  • half-sync-half-async
  • hexagonal
  • intercepting-filter
  • interpreter
  • iterator
  • layers
  • lazy-loading
  • leader-election
  • leader-followers
  • lockable-object
  • marker-interface
  • master-worker
  • mediator
  • memento
  • model-view-controller
  • model-view-presenter
  • model-view-viewmodel
  • module
  • monad
  • monostate
  • multiton
  • mute-idiom
  • naked-objects
  • null-object
  • object-mother
  • object-pool
  • observer
  • page-object
  • parameter-object
  • partial-response
  • pipeline
  • poison-pill
  • presentation-model
  • priority-queue
  • private-class-data
  • producer-consumer
  • promise
  • property
  • prototype
  • proxy
  • queue-based-load-leveling
  • reactor
  • reader-writer-lock
  • registry
  • repository
  • resource-acquisition-is-initialization
  • retry
  • role-object
  • saga
  • semaphore
  • separated-interface
  • servant
  • serverless
  • service-layer
  • service-locator
  • sharding
  • singleton
  • spatial-partition
  • special-case
  • specification
  • state
  • step-builder
  • strangler
  • strategy
  • subclass-sandbox
  • table-module
  • template-method
  • thread-pool
  • throttling
  • thread-local-storage
  • tolerant-reader
  • trampoline
  • transaction-script
  • twin
  • type-object
  • unit-of-work
  • update-method
  • value-object
  • version-number
  • visitor

Changed https://github.com/iluwatar/java-design-patterns/wiki/02.-Pattern-template a bit. There is no diagram anymore. Explanation section was added.

:@iluwatar OK if I work on an explanation for Mediator?

Thanks @pshirley go ahead. Your contribution is warmly welcome!

Hello, I referred to your other explanation and come up with private data class explanation. Would love to have some comment and advice. #1482

Is it available ? @iluwatar

Yes @kanwarpreet25 which pattern do you want to work on?

@iluwatar visitor pattern

@kanwarpreet25 I think it's already in quite good shape. See https://java-design-patterns.com/patterns/visitor/ What aspects would you improve?

Can I start working on this?.
Didn't see anyone assigned to this task. @iluwatar @ohbus

ohbus commented

Can I start working on this?. Didn't see anyone assigned to this task. @iluwatar @ohbus

As this is a continuous effort please feel free to make contributions on the same.

Sounds good @ohbus. Does anyone work on the collection pipeline?

I don't think so, please go ahead @AJESH-CR

May I start working on event-driven-architecture ? @ohbus @iluwatar

ohbus commented

May I start working on event-driven-architecture ? @ohbus @iluwatar

Sure thing! Please go ahead!!

@ohbus, just wondering where can I find the explanations like "https://github.com/kamranahmedse/design-patterns-for-humans" for the above mentioned topics(that are done), coz I might find some useful when I learn them...

ohbus commented

@ohbus, just wondering where can I find the explanations like "https://github.com/kamranahmedse/design-patterns-for-humans" for the above mentioned topics(that are done), coz I might find some useful when I learn them...

More than finding this is about how you would like to explain in simple words what you have understood already.

This is about connecting trivial things that we interact with daily and explaining them in your own way.

I've already done all the explanations part but I haven't got to create the programmatic example. Should I continue doing it? since it will take a long time for me to create the right codes. Thank you :)

ohbus commented

I've already done all the explanations part but I haven't got to create the programmatic example. Should I continue doing it? since it will take a long time for me to create the right codes. Thank you :)

The programmatic examples are already done unless you are implementing a pattern that is yet to be included in this repository.

@iluwatar @ohbus The Changes are ready to review.
Thanks

@iluwatar @ohbus The updates for explanation is ready to review.

Can I work on the twin design pattern?

I've made the pull request but it fails in 1 test and I'm a beginner to open source. Can someone explain why I'm failed in that test.
Test:
if [ -n "${CIRCLE_PR_NUMBER}" ]; then MAVEN_OPTS="-Xmx3000m" xvfb-run ./mvnw -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dsonar.pullrequest.key=${CIRCLE_PR_NUMBER} \ -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} \ -Dsonar.pullrequest.base=master else echo "No Sonar PR analysis as this is not a pull request" fi

@ohbus could you take a look at this ^

@iluwatar could I work on delegation?

Sure, go ahead @JanFidor

@iluwatar @ohbus May I work on the subclass-sandbox?

@iluwatar Could I contribute to the event-queue?
Thanks.

@iluwatar Can I please contribute to the factory-kit?

@iluwatar Can I work on the role-object part? Cheers.

@iluwatar Hello, can I be assigned the data-bus design pattern?

@iluwatar Hi, can I be assigned the reader-writer-lock pattern?

@iluwatar Hi, can I be assigned to the data-mapper design pattern?

Github doesn't allow me to add any more assignees, but consider yourselves hired @steph88ss and @XianWu99

I want to help in this issue

@shubhig226 please mention the pattern you'd like to work on

@iluwatar Can I please work on Producer-Consumer?

Sure, go ahead @ManviGoel26

I have split up this issue into multiple independent ones e.g. "Explanation for Bridge". If you are working on some explanation, please comment on the new issue and I'll assign it to you. I'll close this task now.