Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 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
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
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
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
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
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
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 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
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
65 changes: 33 additions & 32 deletions abstract-factory/etc/abstract-factory.urm.puml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@startuml
package com.iluwatar.abstractfactory {
class App {
- LOGGER : Logger {static}
- army : Army
- castle : Castle
- king : King
Expand All @@ -17,58 +18,58 @@ package com.iluwatar.abstractfactory {
- setCastle(castle : Castle)
- setKing(king : King)
}
class OrcKingdomFactory {
+ OrcKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
interface Army {
+ getDescription() : String {abstract}
}
interface Castle {
+ getDescription() : String {abstract}
}
class ElfArmy {
~ DESCRIPTION : String {static}
+ ElfArmy()
+ getDescription() : String
}
class ElfCastle {
~ DESCRIPTION : String {static}
+ ElfCastle()
+ getDescription() : String
}
class OrcCastle {
class ElfKing {
~ DESCRIPTION : String {static}
+ OrcCastle()
+ ElfKing()
+ getDescription() : String
}
class ElfKingdomFactory {
+ ElfKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
}
interface King {
+ getDescription() : String {abstract}
}
interface KingdomFactory {
+ createArmy() : Army {abstract}
+ createCastle() : Castle {abstract}
+ createKing() : King {abstract}
}
class ElfKing {
class OrcArmy {
~ DESCRIPTION : String {static}
+ ElfKing()
+ OrcArmy()
+ getDescription() : String
}
class ElfArmy {
class OrcCastle {
~ DESCRIPTION : String {static}
+ ElfArmy()
+ OrcCastle()
+ getDescription() : String
}
interface Castle {
+ getDescription() : String {abstract}
}
interface Army {
+ getDescription() : String {abstract}
}
class OrcKing {
~ DESCRIPTION : String {static}
+ OrcKing()
+ getDescription() : String
}
class OrcArmy {
~ DESCRIPTION : String {static}
+ OrcArmy()
+ getDescription() : String
}
interface King {
+ getDescription() : String {abstract}
}
class ElfKingdomFactory {
+ ElfKingdomFactory()
class OrcKingdomFactory {
+ OrcKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
Expand All @@ -77,12 +78,12 @@ package com.iluwatar.abstractfactory {
App --> "-castle" Castle
App --> "-king" King
App --> "-army" Army
OrcKingdomFactory ..|> KingdomFactory
ElfArmy ..|> Army
ElfCastle ..|> Castle
OrcCastle ..|> Castle
ElfKing ..|> King
ElfArmy ..|> Army
OrcKing ..|> King
OrcArmy ..|> Army
ElfKingdomFactory ..|> KingdomFactory
OrcArmy ..|> Army
OrcCastle ..|> Castle
OrcKing ..|> King
OrcKingdomFactory ..|> KingdomFactory
@enduml
2 changes: 1 addition & 1 deletion abstract-factory/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 Down
Loading