Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6b297b7
Data Locality pattern #559 (#889)
ranjeet-floyd Sep 30, 2019
06fa92a
Removing the dead link to resove automagic issue as mentioned in issu…
hbothra15 Sep 30, 2019
3d62e02
fixed bug #929: close async service before the main thread finishes (…
npczwh Sep 30, 2019
b03e0b8
Fix for BallThreadTest#testResume (#935)
wanirudh Oct 1, 2019
823c58b
added new information (#937)
dignat Oct 2, 2019
05d0f0b
#834 Fix dependency management issue for POM files (#940)
perwramdemark Oct 3, 2019
218ba44
Upgrade of maven plugins (#951)
perwramdemark Oct 5, 2019
364c43a
Get rid of build warnings WARNING about problems found when building …
perwramdemark Oct 5, 2019
933de30
Add JXR plugin to get rid of WARNING Unable to locate Source XRef to …
perwramdemark Oct 5, 2019
60171e3
Fix for Issue #549 : Update Exception Handling Code in Aggregator Mic…
jarpit96 Oct 6, 2019
94ca254
Fix for issue #954 : Add external Dependencies to run with Java11 (#957)
jarpit96 Oct 6, 2019
2b1c09a
Fix link in Acyclic Visitor
iluwatar Oct 7, 2019
f5455f9
update buggy dependencies (#968)
Scuilion Oct 7, 2019
84c4b03
Fix: Github reports security vulnerabilities #933 (#960)
gaurav9822 Oct 8, 2019
f903d7e
#496 Pipeline pattern (#967)
jjjimenez100 Oct 8, 2019
41b8d80
Close #969 (#972)
erikgajdos1997 Oct 8, 2019
90ea450
Leader Election Pattern (#923)
Azureyjt Oct 8, 2019
795b6be
Configure Travis to build on JDK8 and JDK11
iluwatar Oct 11, 2019
71f26c3
Fix Travis xvfb
iluwatar Oct 11, 2019
e36bbbb
Maven profiles to support jdk 11 builds. #948 (#975)
lbroman Oct 11, 2019
6faec99
Bump java language to 11 (#980)
lbroman Oct 12, 2019
fcc1c0a
[mvn] - Remove maven-pmd-plugin from the project (#977) (#979)
Shumyk Oct 12, 2019
9ebbc42
Update license headers
iluwatar Oct 12, 2019
72b1746
#996 Fix SonarCloud analysis failure (#997)
iluwatar Oct 13, 2019
cfdfedb
#970 single logging framework should be enforced (#982)
jjjimenez100 Oct 13, 2019
47d92bb
#996 set sonar host url
iluwatar Oct 14, 2019
088bb76
#996 disable sonar analysis for pull requests (#999)
iluwatar Oct 14, 2019
7e698a9
Fix for issue #413: Circuit Breaker Pattern (#986)
PalAditya Oct 14, 2019
e6c71b6
988: Replaced all of the Apache HttpClients with Java's java.net.http…
oconnelc Oct 15, 2019
dd5997b
993: Fixed the pipeines project layout so that it will load in Eclips…
oconnelc Oct 15, 2019
c438ec0
Intermittent test failure in Spatial Partition pattern #1001 (#1006)
afflato Oct 15, 2019
27c131c
#1001 fix intermittent test failure (#1008)
Smirne Oct 15, 2019
a5646b6
#554: Subclass Sandbox pattern (#998)
Azureyjt Oct 16, 2019
880b234
Fixes #1007 by updating JUnit to 5.5.2 (#1015)
kaiwinter Oct 17, 2019
c308ca0
1011: Fixed all of the SonarCloud blocking errors (#1017)
oconnelc Oct 18, 2019
2982db4
Update README.md
iluwatar Oct 18, 2019
0c60a95
Switched to embedded Google checkstyle rules (#1018)
kaiwinter Oct 19, 2019
8a48447
Remove obsolete file
iluwatar Oct 19, 2019
7c5d5f6
1010: Fixed all of the blocking and critical Sonarcloud errors (#1020)
oconnelc Oct 19, 2019
f671f03
Update FAQ metadata
iluwatar Oct 19, 2019
82f9a6c
1010: Fixed the two remaining SonarCloud errors (#1023)
oconnelc Oct 20, 2019
2217fbc
Issue#550: double buffer pattern (#1024)
Azureyjt Oct 20, 2019
f00ebe1
#984 local variable inference changes (#1025)
Anurag870 Oct 20, 2019
5fc03ee
improve grammar of README (#945)
jonlaokan Oct 20, 2019
c81c3ff
Use local variable type inference (#995)
Oct 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ datanucleus.log
/bin/
/bin/
*.log
data-mapper/src/main/resources/log4j.xml
event-sourcing/Journal.json
38 changes: 0 additions & 38 deletions .sonarcloud.properties

This file was deleted.

35 changes: 16 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
language: java
dist: trusty # Xenial build environment won't allow installation of Java 8
dist: bionic
jdk:
- oraclejdk8
- openjdk11
sudo: required

env:
global:
- GH_REF: github.com/iluwatar/java-design-patterns.git
- secure: LxTDuNS/rBWIvKkaEqr79ImZAe48mCdoYCF41coxNXgNoippo4GIBArknqtv+XvdkiuRZ1yGyj6pn8GU33c/yn+krddTUkVCwTbVatbalW5jhQjDbHYym/JcxaK9ZS/3JTeGcWrBgiPqHEEDhCf26vPZsXoMSeVCEORVKTp1BSg=
- secure: "eoWlW9GyTJY04P8K3pxayXwU9/hmptQg/LfirispQkV9YvmziCfSzXnatnBhNfud98sCzY8BScXnb+OWLTnjLKpId4rtEqb0aJ40Jc32cUKzgzFAUn7cNcDAbUIfyPAGVqyQqfj/11wYSADwWMMOPlW97ExUtoyiH2WenXuRHso="

before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

# default install command is just "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V"
install:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -e
services:
- xvfb

addons:
sonarcloud:
organization: "iluwatar"
token:
secure: "FpHwMYPMkdWU6CeIB7+O3qIeIM4vJMp47UjkKK53f0w0s6tPZofZZkab+gcL2TqKSil7sFVB/AQXU1cUubflRszwcLbNsc8H2yFehD79o0o0Mqd1Dd5ip/q0KQbHkkln+InFlVLfvrLB4Xd4mlQVxbGhqpULBhXjKzFzQlRFcuU="
script:
# Because of Travis security restrictions, SonarCloud analysis cannot be run on pull requests originated from forks
# See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then mvn clean verify; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn clean verify sonar:sonar -Dsonar.projectKey=iluwatar_java-design-patterns -Dsonar.host.url=https://sonarcloud.io; fi'

after_success:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
- bash update-ghpages.sh

# use latest java version available instead of travis default
addons:
apt:
packages:
- oracle-java8-installer

notifications:
email:
- iluwatar@gmail.com
Expand All @@ -36,5 +35,3 @@ notifications:
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

sudo: required
13 changes: 0 additions & 13 deletions CODE_COVERAGE.md

This file was deleted.

20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ 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 which cause major
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 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
Programming/Software Design Principles.
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
Expand All @@ -35,12 +42,17 @@ Once you are familiar with these concepts you can start drilling down into
patterns by any of the following approaches

- Using difficulty tags, `Difficulty-Beginner`, `Difficulty-Intermediate` & `Difficulty-Expert`.
- Using pattern categories, `Creational`, `Behavioral` and others.
- Using pattern categories, `Creational`, `Behavioral`, and others.
- Search for a specific pattern. Can't find one? Please report a new pattern [here](https://github.com/iluwatar/java-design-patterns/issues).

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](https://github.com/iluwatar/java-design-patterns/wiki). We will help you and answer your questions in the [Gitter chatroom](https://gitter.im/iluwatar/java-design-patterns).
If you are willing to contribute to the project you will find the relevant information in
our [developer wiki](https://github.com/iluwatar/java-design-patterns/wiki). We will help
you and answer your questions in the [Gitter chatroom](https://gitter.im/iluwatar/java-design-patterns).

# License

Expand Down
2 changes: 1 addition & 1 deletion abstract-document/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--

The MIT License
Copyright (c) 2014-2016 Ilkka Seppälä
Copyright © 2014-2019 Ilkka Seppälä

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -61,7 +61,7 @@ public <T> Stream<T> children(String key, Function<Map<String, Object>, T> const

@Override
public String toString() {
StringBuilder builder = new StringBuilder();
var builder = new StringBuilder();
builder.append(getClass().getName()).append("[");
properties.forEach((key, value) -> builder.append("[").append(key).append(" : ").append(value).append("]"));
builder.append("]");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -24,7 +24,6 @@

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -52,23 +51,23 @@ public class App {
public App() {
LOGGER.info("Constructing parts and car");

Map<String, Object> carProperties = new HashMap<>();
var carProperties = new HashMap<String, Object>();
carProperties.put(Property.MODEL.toString(), "300SL");
carProperties.put(Property.PRICE.toString(), 10000L);

Map<String, Object> wheelProperties = new HashMap<>();
var wheelProperties = new HashMap<String, Object>();
wheelProperties.put(Property.TYPE.toString(), "wheel");
wheelProperties.put(Property.MODEL.toString(), "15C");
wheelProperties.put(Property.PRICE.toString(), 100L);

Map<String, Object> doorProperties = new HashMap<>();
var doorProperties = new HashMap<String, Object>();
doorProperties.put(Property.TYPE.toString(), "door");
doorProperties.put(Property.MODEL.toString(), "Lambo");
doorProperties.put(Property.PRICE.toString(), 300L);

carProperties.put(Property.PARTS.toString(), Arrays.asList(wheelProperties, doorProperties));

Car car = new Car(carProperties);
var car = new Car(carProperties);

LOGGER.info("Here is our car:");
LOGGER.info("-> model: {}", car.getModel().get());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* Copyright © 2014-2019 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p>
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
Loading