Compare commits

...

11 Commits

Author SHA1 Message Date
allcontributors[bot]
8a0546b461 docs: update .all-contributorsrc [skip ci] 2021-12-06 09:58:08 +00:00
allcontributors[bot]
1caa06f4d3 docs: update README.md [skip ci] 2021-12-06 09:58:07 +00:00
Abhinav Vashisth
414e3263b1 docs: Correcting some grammatical errors of README.md (#1911)
* Update README.md

Corrected some sentences grammatically.

* Update README.md

Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>

* Update README.md

Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
2021-12-06 11:56:46 +02:00
Ilkka Seppälä
2674cb9523 Set version for the next development iteration 2021-11-11 21:49:55 +02:00
Ilkka Seppälä
925755fa35 Reach milestone 1.25.0 2021-11-11 21:47:49 +02:00
Zhang WH
89b2072131 fix: use double check to fix concurrent problem (#1909)
Co-authored-by: zhangwenhe <zhangwh@ehualu.com>
2021-11-11 19:46:24 +02:00
allcontributors[bot]
0a7b524bd1 docs: add harshalkh as a contributor for code (#1900)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-10-31 09:12:05 +02:00
Harshal
36c6ce1df7 sonar fix: Update App.java (#1896)
* Update App.java

Sonar issue fix

* Update App.java
2021-10-31 09:10:58 +02:00
Harshal
22ddd57146 sonar fix: Update App.java (#1898) 2021-10-31 09:08:49 +02:00
Subhrodip Mohanta
72bb189dc0 CI: Update Workflows (#1879)
* Update Workflows

#1875

* Updated requested changes
2021-10-27 21:44:00 +03:00
Fiordy
bee1283371 docs: updated example with lombok as per code (#1891) 2021-10-24 17:27:24 +03:00
165 changed files with 262 additions and 212 deletions

View File

@@ -1712,6 +1712,24 @@
"contributions": [
"doc"
]
},
{
"login": "harshalkh",
"name": "Harshal",
"avatar_url": "https://avatars.githubusercontent.com/u/37841724?v=4",
"profile": "https://github.com/harshalkh",
"contributions": [
"code"
]
},
{
"login": "vashisthabhinav",
"name": "Abhinav Vashisth",
"avatar_url": "https://avatars.githubusercontent.com/u/89785800?v=4",
"profile": "https://www.linkedin.com/in/abhinav-vashisth-06613b208/",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,

View File

@@ -24,6 +24,9 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# We are using two jobs here for testing our code on the latest JDK 11 build as well as a more satble build version of 11.0.3
# You can see the full discussion here https://github.com/iluwatar/java-design-patterns/pull/1868#issue-1029459688
name: Java CI
on:
@@ -33,12 +36,11 @@ on:
jobs:
build:
# This Workflow Job will build this project and run Sonar analysis using JDK 11.0.3
build-and-analyze:
name: Build and Run Sonar analysis on JDK 11.0.3
runs-on: ubuntu-20.04
strategy:
matrix:
java-version: [ 11.0.3, 11 ]
steps:
- name: Checkout Code
@@ -47,12 +49,14 @@ jobs:
# Disabling shallow clone for improving relevancy of SonarQube reporting
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
- name: Set up JDK 11.0.3
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
java-version: 11.0.3
distribution: 'zulu'
cache: 'maven'
# Cache Sonar packages which as used to run anaylysis and collect metrics
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
@@ -60,14 +64,6 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb
@@ -78,3 +74,28 @@ jobs:
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# This Workflow Job is going to build the project on the latest stable JDK 11
build:
name: Build and Test on JDK 11
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up JDK 11 (Latest)
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
cache: 'maven'
# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install -y xvfb
- name: Build with Maven
run: xvfb-run ./mvnw clean verify

View File

@@ -34,11 +34,13 @@ on:
jobs:
build:
name: Build JDP
runs-on: ubuntu-20.04
strategy:
matrix:
java-version: [ 11.0.3, 11 ]
steps:
- name: Checkout Code
uses: actions/checkout@v2
@@ -47,14 +49,7 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: Cache Maven Dependecies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
# Some tests need screen access
- name: Install xvfb

View File

@@ -10,7 +10,7 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=coverage)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
[![Join the chat at https://gitter.im/iluwatar/java-design-patterns](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iluwatar/java-design-patterns?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-188-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-190-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<br/>
@@ -21,7 +21,7 @@ Read in different language : [**zh**](localization/zh/README.md), [**ko**](local
# Introduction
Design patterns are the best formalized practices a programmer can use to
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
@@ -34,11 +34,11 @@ 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
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 of as
programming tutorials on how to implement a specific pattern. We use the most
popular battle-proven open source Java technologies.
popular battle-proven open-source Java technologies.
Before you dive into the material, you should be familiar with various
[Software Design Principles](https://java-design-patterns.com/principles/).
@@ -56,8 +56,8 @@ of the following approaches
- 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.
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 while developing them.
# How to contribute
@@ -316,6 +316,10 @@ This project is licensed under the terms of the MIT license.
<td align="center"><a href="https://github.com/blueberry404"><img src="https://avatars.githubusercontent.com/u/39243539?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anum Amin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=blueberry404" title="Documentation">📖</a></td>
<td align="center"><a href="https://uh-zz.github.io/blog/"><img src="https://avatars.githubusercontent.com/u/47747828?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Reo Uehara</b></sub></a><br /><a href="#translation-uh-zz" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/Fiordy"><img src="https://avatars.githubusercontent.com/u/53420573?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Fiordy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Fiordy" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/harshalkh"><img src="https://avatars.githubusercontent.com/u/37841724?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harshal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=harshalkh" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://www.linkedin.com/in/abhinav-vashisth-06613b208/"><img src="https://avatars.githubusercontent.com/u/89785800?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Abhinav Vashisth</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vashisthabhinav" title="Documentation">📖</a></td>
</tr>
</table>

View File

@@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-document</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-factory</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>active-object</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>acyclic-visitor</artifactId>
<properties>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>adapter</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aggregator-service</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>information-microservice</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inventory-microservice</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aggregator-microservices</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ambassador</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-gateway-service</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>image-microservice</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-gateway</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>api-gateway</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>price-microservice</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>arrange-act-assert</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>async-method-invocation</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>balking</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>bridge</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>builder</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>business-delegate</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>bytecode</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>caching</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>callback</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>chain-of-responsibility</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>circuit-breaker</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>collection-pipeline</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>combinator</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>command</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>commander</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>composite-entity</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>composite</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>converter</artifactId>
<modelVersion>4.0.0</modelVersion>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>cqrs</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>dao</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>data-bus</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>data-locality</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>data-mapper</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>data-transfer-object</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>decorator</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>delegation</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>dependency-injection</artifactId>
<dependencies>

View File

@@ -28,10 +28,10 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>dirty-flag</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
<name>dirty-flag</name>
<url>http://maven.apache.org</url>
<properties>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>domain-model</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>double-buffer</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>double-checked-locking</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>double-dispatch</artifactId>
<dependencies>

View File

@@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>eip-message-channel</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>eip-publish-subscribe</artifactId>
<dependencies>

View File

@@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>

View File

@@ -29,7 +29,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>event-aggregator</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>event-asynchronous</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>event-driven-architecture</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>event-queue</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>event-sourcing</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>execute-around</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extension-objects</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>facade</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>factory-kit</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>factory-method</artifactId>
<dependencies>

View File

@@ -41,6 +41,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class App {
private static final String MANUFACTURED = "{} manufactured {}";
/**
* Program entry point.
* @param args command line args
@@ -49,14 +51,14 @@ public class App {
Blacksmith blacksmith = new OrcBlacksmith();
Weapon weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
blacksmith = new ElfBlacksmith();
weapon = blacksmith.manufactureWeapon(WeaponType.SPEAR);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
weapon = blacksmith.manufactureWeapon(WeaponType.AXE);
LOGGER.info("{} manufactured {}", blacksmith, weapon);
LOGGER.info(MANUFACTURED, blacksmith, weapon);
}
}

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>factory</artifactId>
<dependencies>

View File

@@ -31,7 +31,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fanout-fanin</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>feature-toggle</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>filterer</artifactId>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fluentinterface</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>flux</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>flyweight</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>front-controller</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>game-loop</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<artifactId>guarded-suspension</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>half-sync-half-async</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>hexagonal</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>intercepting-filter</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>interpreter</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>iterator</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<groupId>com.iluwatar.layers</groupId>
<artifactId>layers</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>lazy-loading</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>leader-election</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>leader-followers</artifactId>
<dependencies>

View File

@@ -57,9 +57,11 @@ public class Worker implements Runnable {
try {
if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
synchronized (workCenter) {
workCenter.wait();
if (workCenter.getLeader() != null && !workCenter.getLeader().equals(this)) {
workCenter.wait();
continue;
}
}
continue;
}
final Task task = taskSet.getTask();
synchronized (workCenter) {

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>lockable-object</artifactId>
<dependencies>

View File

@@ -27,7 +27,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>marker</artifactId>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>master-worker-pattern</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>mediator</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>memento</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>model-view-controller</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>model-view-presenter</artifactId>
<name>model-view-presenter</name>

View File

@@ -32,11 +32,11 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<groupId>com.iluwatar</groupId>
<artifactId>model-view-viewmodel</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
<properties>
<zk.version>9.0.0</zk.version>
<guava.version>19.0</guava.version>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>module</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>monad</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>monostate</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>multiton</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>mute-idiom</artifactId>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>naked-objects</artifactId>
<version>1.25.0-SNAPSHOT</version>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>naked-objects-dom</artifactId>
<build>

Some files were not shown because too many files have changed in this diff Show More