Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
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
4904d7e
#1021: Fix checkstyle warnings by changing the license header templat…
vanogrid Oct 22, 2019
acaa6cd
local variable type inference changes (#1028)
gvsharma Oct 23, 2019
1b6cecd
Update keywords
iluwatar Oct 24, 2019
1cb1bdc
https://github.com/iluwatar/java-design-patterns/issues/1009 - remove…
akrystian Oct 25, 2019
6aeafcf
https://github.com/iluwatar/java-design-patterns/issues/1016 - decrea…
akrystian Oct 26, 2019
70ddeaa
Create FUNDING.yml
iluwatar Oct 26, 2019
f7a53f2
service-layer local type inference changes (#1034)
gvsharma Oct 26, 2019
58d8fa1
local variable type inference changes (#1035)
gvsharma Oct 26, 2019
0b8d78e
local variable type inference changes (#1036)
gvsharma Oct 26, 2019
12f13a6
local variable infere changes (#1038)
gvsharma Oct 26, 2019
349d8ed
local variable type inference changes (#1039)
gvsharma Oct 26, 2019
af8c5ed
local variable type inference changes (#1040)
gvsharma Oct 26, 2019
03e1e92
local variable type inference changes (#1041)
gvsharma Oct 26, 2019
954e730
local variable type inference changes (#1043)
gvsharma Oct 26, 2019
c7fee7b
local variable type inference changes (#1042)
gvsharma Oct 26, 2019
fadad43
#984 for unitofwork, tolerantreader, twin (#1044)
Anurag870 Oct 26, 2019
d01a3a6
Update Github token
iluwatar Oct 26, 2019
5d47488
Fix error when building from a submodule directory (#1045)
vanogrid Oct 26, 2019
d1767bb
The pattern Role object (#1031)
besok Oct 26, 2019
9f7e3fe
Update license headers
iluwatar Oct 26, 2019
b50189e
Fix Role Object front matter
iluwatar Oct 26, 2019
63fb8dc
Add java 11 (#1048)
leonmak Oct 27, 2019
6bb3438
Add java 11 (#1049)
leonmak Oct 27, 2019
dd971d8
Use java 11 (#1050)
leonmak Oct 28, 2019
c8a481b
Add java 11 support for #987 (o-t) (#1051)
leonmak Oct 29, 2019
a65a601
Update web site logic
iluwatar Oct 29, 2019
ccc1a63
Update script
iluwatar Oct 29, 2019
ff52848
Update script
iluwatar Oct 29, 2019
91a085d
Update script
iluwatar Oct 30, 2019
fca7e9c
https://github.com/iluwatar/java-design-patterns/issues/1021 - decrea…
akrystian Oct 30, 2019
a9dfd7e
Update license header
iluwatar Oct 30, 2019
cdb80b8
Issue 893 (#1014)
hbothra15 Oct 30, 2019
cc85c73
Move faq.md to java-design-patterns-web repository
iluwatar Oct 30, 2019
1eb1961
Remove presentations
iluwatar Oct 30, 2019
3b1a281
decrease number of checkstyle errors in singleton, strategy and visit…
leonorader Oct 31, 2019
55b0341
Fix remaining Checkstyle errors for Singleton
iluwatar Oct 31, 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: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [iluwatar]
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.

40 changes: 18 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
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
- secure: "DCpazS3nkLnter3sguXEAS2fC/1ZWNfM+XLyif9MfNFxlZdpni2vCD/jA0Rdpga8puQWHNVLyAec+RPFH/2qSmJ1c1UTV5MaLv8tPqwUX0VFA+1I6XoSv6oX4ldHTBWHEWqQHkRFOLoil0h0edc0tTOWQwXF8U+DLAB+HkRb4gw="

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
services:
- xvfb

# use latest java version available instead of travis default
addons:
apt:
packages:
- oracle-java8-installer
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:
- bash update-website.sh

notifications:
email:
Expand All @@ -36,5 +34,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 All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import java.util.List;
Expand Down Expand Up @@ -61,7 +62,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 @@ -20,17 +20,16 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
package com.iluwatar.abstractdocument;

import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.enums.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.List;
import java.util.Map;

/**
* The Abstract Document pattern enables handling additional, non-static
Expand All @@ -52,23 +51,22 @@ public class App {
public App() {
LOGGER.info("Constructing parts and car");

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

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

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

carProperties.put(Property.PARTS.toString(), Arrays.asList(wheelProperties, doorProperties));
var carProperties = Map.of(
Property.MODEL.toString(), "300SL",
Property.PRICE.toString(), 10000L,
Property.PARTS.toString(), List.of(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 All @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument;

import java.util.Map;
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 @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Map;
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 @@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.abstractdocument.domain;

import java.util.Optional;
Expand Down
Loading