Skip to content

. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 73 commits into from
Feb 13, 2017
Merged

. #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3a9d168
Initial commit of the object mother #498
igeligel Oct 4, 2016
863ea75
Add PlantUML file for the UML diagram #498
igeligel Oct 6, 2016
8506078
End process logic clause has been corrected.
dzmitryh Oct 15, 2016
37b930c
Unused import removed.
dzmitryh Oct 15, 2016
1c02785
Add SonarQube.com badge
bellingard Oct 23, 2016
0438811
#502 Replaced usages of System.out with logger.
Oct 23, 2016
56b0884
Change name of variables in test #498
igeligel Oct 24, 2016
2029531
add entry to parent pom.xml #498
igeligel Oct 24, 2016
750fa4f
Merge Changes of the master repository
igeligel Oct 24, 2016
74ac79b
Fix pom.xml
igeligel Oct 24, 2016
6aed26e
Fix pom.xml
igeligel Oct 24, 2016
2a77ac2
FirstCut++
inbravo Oct 26, 2016
7015e95
SecondCut++
inbravo Oct 27, 2016
1ace4c0
App++
inbravo Oct 27, 2016
7ba6cb4
App
inbravo Oct 27, 2016
ea7752c
checkstyle errors removed
inbravo Oct 27, 2016
27d6d50
#502 Reverted changes in composite example, due to nature of this exa…
Oct 28, 2016
932700d
Merge pull request #506 from dzmitryh/master
iluwatar Oct 28, 2016
9433c78
Merge pull request #510 from bellingard/patch-1
iluwatar Oct 28, 2016
124fd33
Remove use of coveralls-maven-plugin (sonarqube.com covers this)
iluwatar Nov 1, 2016
e138163
#502 Adjusted tests for logger introduction
Nov 4, 2016
0a42771
Merge branch 'master' of https://github.com/iluwatar/java-design-patt…
Nov 4, 2016
b37190a
#502 Introduced logging in new example
Nov 4, 2016
6f3e298
Create presentation template
iluwatar Nov 6, 2016
e1ae106
Link Hexagonal Architecture pattern to corresponding blog entry
iluwatar Nov 6, 2016
4c24d99
Work on Hexagonal Architecture presentation
iluwatar Nov 12, 2016
c850295
Add new diagram
iluwatar Nov 13, 2016
22d973c
Merge branch 'master' into presentation
iluwatar Nov 13, 2016
1abf5b1
Add presentation link to README.md
iluwatar Nov 13, 2016
9180bb0
Update App.java
thomasoss Nov 14, 2016
4ff8fa3
Review comments++
inbravo Nov 15, 2016
f67d2fd
Review comments++
inbravo Nov 15, 2016
95b651f
Merge pull request #520 from thomasoss/patch-1
iluwatar Nov 15, 2016
3091ff2
#502 Reduced amount of information logged
Nov 17, 2016
68ec24c
Merge pull request #515 from dbryla/master
iluwatar Nov 18, 2016
12b70cb
Issue #450. First commit. Queue Based Load Leveling
Nov 20, 2016
52a81eb
Issue #450. Updated pom.xml
Nov 20, 2016
d6b5456
Updated checkstyle errors.
Nov 20, 2016
e8f7187
Updated pom.xml with maven-pmd-plugin
Amarnath510 Nov 22, 2016
5e7887d
Reverted pom.xml changes that are done previously.
Amarnath510 Nov 22, 2016
b9ac0dc
Fixed PMD issue.
Nov 22, 2016
92f8501
Decorator pattern: Improve the example
iluwatar Nov 22, 2016
1a75ab8
Removed unused imports in tests
Nov 23, 2016
82d3d7b
Proxy pattern: Improve the example
iluwatar Nov 23, 2016
8574e06
Proxy pattern: Add missing license header
iluwatar Nov 23, 2016
7d99505
Update URM Version to 1.4.4 and regenerated all puml files
Nov 26, 2016
cc02ff4
Merge pull request #503 from igeligel/master
iluwatar Nov 26, 2016
89e7f51
Merge pull request #519 from iluwatar/presentation
iluwatar Nov 27, 2016
faa29f8
Update license headers
iluwatar Nov 27, 2016
1387e2b
Fixed all the code changes after review
Nov 28, 2016
1d6d0c5
pom.xml Fixed Conflict
Nov 28, 2016
efc2c88
Merge pull request #521 from Amarnath510/master
iluwatar Nov 28, 2016
5d88068
Review comments++
inbravo Dec 1, 2016
c94c8a3
Merge pull request #512 from inbravo/master
iluwatar Dec 1, 2016
120033b
Sonar bug fixes using Yoda condition in equals expression when compar…
valdar-hu Dec 18, 2016
95f2c19
Sonar bug fixes using Yoda condition in equals expression when compar…
valdar-hu Dec 18, 2016
20b1c2b
Adding initialization on demand holder idiom.
leogtzr Dec 24, 2016
ad93184
Merge pull request #530 from Valdar-Soft/master
iluwatar Dec 24, 2016
6292690
Changing constant interface pattern with a Noninstantiable class
leogtzr Dec 24, 2016
5e57cd0
Add some material for proxy presentation.
iluwatar Dec 26, 2016
9cf1918
Add presentation for Proxy pattern.
iluwatar Dec 26, 2016
512a5c0
Merge branch 'proxy-presentation'
iluwatar Dec 26, 2016
8d34ccf
Add link to Proxy presentation.
iluwatar Dec 26, 2016
0c48695
Achieved milestone 1.14.0
iluwatar Dec 31, 2016
0c8bb1c
Set version for next development iteration
iluwatar Dec 31, 2016
29c5b80
#525 Add link to Queue-Based Load Leveling blog
iluwatar Jan 21, 2017
115a853
#525 Add link to proxy blog
iluwatar Jan 21, 2017
d6fc28e
Changing code to use interfaces instead of implementations.
leogtzr Jan 21, 2017
e262155
Changing code to use interfaces instead of implementations.
leogtzr Jan 21, 2017
c6d0d28
Reverting initialization on demand holder idiom.
leogtzr Jan 22, 2017
9ec0935
Merge pull request #532 from leogtzr/master
iluwatar Jan 23, 2017
a1ff55b
#190 Regenerate puml files
iluwatar Feb 11, 2017
cca4760
#190 Rename package for Queue-Based Load Leveling pattern
iluwatar Feb 11, 2017
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
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
target
.metadata
.settings
.classpath
.project
*.class
# Package Files #
*.jar
*.war
*.ear
.idea
*.iml
*.swp
target
.metadata
.settings
.classpath
.project
*.class
# Package Files #
*.jar
*.war
*.ear
.idea
*.iml
*.swp
datanucleus.log
/bin/
/bin/
/bin/
data-mapper/src/main/resources/log4j.xml
*.log
data-mapper/src/main/resources/log4j.xml
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ install:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -e

after_success:
- mvn clean test jacoco:report coveralls:report
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_TOKEN
- bash update-ghpages.sh

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Design patterns implemented in Java

[![Build status](https://travis-ci.org/iluwatar/java-design-patterns.svg?branch=master)](https://travis-ci.org/iluwatar/java-design-patterns)
[![Coverage Status](https://coveralls.io/repos/iluwatar/java-design-patterns/badge.svg?branch=master)](https://coveralls.io/r/iluwatar/java-design-patterns?branch=master)
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/iluwatar/java-design-patterns/master/LICENSE.md)
[![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)
[![Quality Gate](https://sonarqube.com/api/badges/gate?key=com.iluwatar%3Ajava-design-patterns)](https://sonarqube.com/dashboard/index/com.iluwatar%3Ajava-design-patterns)

# Introduction

Expand Down
2 changes: 1 addition & 1 deletion _scripts/postPumlsToServer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# The MIT License
# Copyright (c) 2014 Ilkka Seppälä
# Copyright (c) 2014-2016 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
42 changes: 21 additions & 21 deletions abstract-document/etc/abstract-document.urm.puml
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
@startuml
package com.iluwatar.abstractdocument.domain {
class Part {
+ Part(properties : Map<String, Object>)
class Car {
+ Car(properties : Map<String, Object>)
}
interface HasPrice {
interface HasModel {
+ PROPERTY : String {static}
+ getPrice() : Optional<Number>
+ getModel() : Optional<String>
}
interface HasParts {
+ PROPERTY : String {static}
+ getParts() : Stream<Part>
}
class Car {
+ Car(properties : Map<String, Object>)
interface HasPrice {
+ PROPERTY : String {static}
+ getPrice() : Optional<Number>
}
interface HasType {
+ PROPERTY : String {static}
+ getType() : Optional<String>
}
interface HasModel {
+ PROPERTY : String {static}
+ getModel() : Optional<String>
class Part {
+ Part(properties : Map<String, Object>)
}
}
package com.iluwatar.abstractdocument {
class App {
+ App()
+ main(args : String[]) {static}
}
abstract class AbstractDocument {
- properties : Map<String, Object>
# AbstractDocument(properties : Map<String, Object>)
Expand All @@ -36,24 +32,28 @@ package com.iluwatar.abstractdocument {
+ put(key : String, value : Object)
+ toString() : String
}
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
interface Document {
+ children(String, Function<Map<String, Object>, T>) : Stream<T> {abstract}
+ get(String) : Object {abstract}
+ put(String, Object) {abstract}
}
}
AbstractDocument --+ Map
Part ..|> HasType
Part ..|> HasModel
Part ..|> HasPrice
Part --|> AbstractDocument
AbstractDocument ..|> Document
HasPrice --|> Document
HasParts --|> Document
Car ..|> HasModel
Car ..|> HasPrice
Car ..|> HasParts
Car --|> AbstractDocument
HasType --|> Document
HasModel --|> Document
HasParts --|> Document
HasPrice --|> Document
HasType --|> Document
Part ..|> HasType
Part ..|> HasModel
Part ..|> HasPrice
Part --|> AbstractDocument
@enduml
4 changes: 2 additions & 2 deletions 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 Ilkka Seppälä
Copyright (c) 2014-2016 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 All @@ -29,7 +29,7 @@
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.14.0-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-document</artifactId>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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 All @@ -27,6 +27,8 @@
import com.iluwatar.abstractdocument.domain.HasParts;
import com.iluwatar.abstractdocument.domain.HasPrice;
import com.iluwatar.abstractdocument.domain.HasType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.HashMap;
Expand All @@ -44,11 +46,13 @@
*/
public class App {

private static final Logger LOGGER = LoggerFactory.getLogger(App.class);

/**
* Executes the App
*/
public App() {
System.out.println("Constructing parts and car");
LOGGER.info("Constructing parts and car");

Map<String, Object> carProperties = new HashMap<>();
carProperties.put(HasModel.PROPERTY, "300SL");
Expand All @@ -68,12 +72,11 @@ public App() {

Car car = new Car(carProperties);

System.out.println("Here is our car:");
System.out.println("-> model: " + car.getModel().get());
System.out.println("-> price: " + car.getPrice().get());
System.out.println("-> parts: ");
car.getParts().forEach(p -> System.out
.println("\t" + p.getType().get() + "/" + p.getModel().get() + "/" + p.getPrice().get()));
LOGGER.info("Here is our car:");
LOGGER.info("-> model: {}", car.getModel().get());
LOGGER.info("-> price: {}", car.getPrice().get());
LOGGER.info("-> parts: ");
car.getParts().forEach(p -> LOGGER.info("\t{}/{}/{}", p.getType().get(), p.getModel().get(), p.getPrice().get()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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,6 +1,6 @@
/**
* The MIT License
* Copyright (c) 2014 Ilkka Seppälä
* Copyright (c) 2014-2016 Ilkka Seppälä
* <p>
* 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
Loading