Compare commits

..

457 Commits

Author SHA1 Message Date
59fe601c5d docs: update .all-contributorsrc [skip ci] 2020-07-29 17:20:27 +00:00
22be0b74ab docs: update README.md [skip ci] 2020-07-29 17:20:26 +00:00
ec7a2025f0 docs: add iamrichardjones as a contributor (#1455)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:19:47 +03:00
de79019ece docs: add Jahhein as a contributor (#1454)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:18:15 +03:00
f2ac53edca docs: add Bobo1239 as a contributor (#1453)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:16:54 +03:00
c9e30390d3 docs: add vertti as a contributor (#1452)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:14:42 +03:00
f49f9a15b6 docs: add d4gg4d as a contributor (#1451)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:13:24 +03:00
f878bf63aa docs: add sivasubramanim as a contributor (#1450)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:11:51 +03:00
51ef7176b1 docs: add grzesiekkedzior as a contributor (#1449)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:08:47 +03:00
047285aed7 docs: add PalAditya as a contributor (#1448)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:07:30 +03:00
4db3a1cfb2 docs: add varunu28 as a contributor (#1447)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:06:01 +03:00
075fbe7433 docs: add yorlov as a contributor (#1446)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 20:04:33 +03:00
1f0a24cefa docs: add trautonen as a contributor (#1445)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-29 19:59:40 +03:00
69341ff712 docs: add IAmPramod as a contributor (#1443)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:53:14 +03:00
a1b2ab129e docs: add Amarnath510 as a contributor (#1442)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:51:03 +03:00
87c2644842 docs: add Anurag870 as a contributor (#1441)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:49:20 +03:00
1d025b7019 docs: add Deathnerd as a contributor (#1440)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:47:29 +03:00
34a36cb519 docs: add Harshrajsinh as a contributor (#1439)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:45:07 +03:00
62ac59afda docs: add MaVdbussche as a contributor (#1438)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:43:26 +03:00
beffc87deb docs: add alexsomai as a contributor (#1437)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:41:47 +03:00
706c5092c1 docs: add amogozov as a contributor (#1436)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:40:00 +03:00
e222a69964 docs: add anthonycampbell as a contributor (#1435)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:38:23 +03:00
9483888b5e docs: add christophercolumbusdog as a contributor (#1434)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:36:36 +03:00
73d55afd58 docs: add dzmitryh as a contributor (#1433)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:34:58 +03:00
1f900d164d docs: add jjjimenez100 as a contributor (#1432)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:33:18 +03:00
5d21a03acd docs: add kaiwinter as a contributor (#1431)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:31:35 +03:00
6c9b912620 docs: add lbroman as a contributor (#1430)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:29:55 +03:00
7fdcd2ec5a docs: add pnowy as a contributor (#1429)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:28:18 +03:00
dafe495610 docs: add prafful1 as a contributor (#1428)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:26:38 +03:00
6f0035e7c2 docs: add sankypanhale as a contributor (#1427)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:25:03 +03:00
652a68b134 docs: add staillebois as a contributor (#1426)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:23:12 +03:00
b5fac5cf86 docs: add valdar-hu as a contributor (#1425)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:21:22 +03:00
ecb7b44f97 docs: add vanogrid as a contributor (#1424)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:19:24 +03:00
1841fba831 docs: add yosfik as a contributor (#1423)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:17:45 +03:00
325f0d93b2 docs: add 7agustibm as a contributor (#1422)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:16:02 +03:00
efd8c8156e docs: add Juaanma as a contributor (#1421)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:14:26 +03:00
ae57ec75f3 docs: add LuigiCortese as a contributor (#1420)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:12:46 +03:00
47acedaaf7 docs: add Rzeposlaw as a contributor (#1419)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 19:10:44 +03:00
65d627b2ed docs: add akrystian as a contributor (#1418)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:49:46 +03:00
b4e4cf9cfe docs: add baislsl as a contributor (#1417)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:48:09 +03:00
b67a019c48 docs: add besok as a contributor (#1416)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:45:53 +03:00
1bbae5fd5a docs: add dmitraver as a contributor (#1415)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:44:29 +03:00
d11b2f06ea docs: add fanofxiaofeng as a contributor (#1414)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:42:55 +03:00
2a66fec6fe docs: add hoangnam2261 as a contributor (#1413)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:41:17 +03:00
a475df845b docs: add jarpit96 as a contributor (#1412)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:38:07 +03:00
1bc77a80f2 docs: add joningiwork as a contributor (#1411)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:36:27 +03:00
9b5ae765fc docs: add kirill-vlasov as a contributor (#1410)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:34:45 +03:00
8e268cf261 docs: add mitchellirvin as a contributor (#1409)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:32:59 +03:00
fe2f8f74a1 docs: add ranjeet-floyd as a contributor (#1408)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:29:41 +03:00
e2a42b0051 docs: add Alwayswithme as a contributor (#1407)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:28:10 +03:00
54bb02f691 docs: add MSaifAsif as a contributor (#1406)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:26:34 +03:00
a70213f852 docs: add kanwarpreet25 as a contributor (#1405)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:25:03 +03:00
19929d9e72 docs: add leonmak as a contributor (#1404)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:23:23 +03:00
09880e3850 docs: add perwramdemark as a contributor (#1403)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:21:41 +03:00
96bfb8bd9f docs: add waisuan as a contributor (#1402)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:19:53 +03:00
a727a1d05b docs: add AnaghaSasikumar as a contributor (#1401)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:18:07 +03:00
46fdc5a54f docs: add christofferh as a contributor (#1400)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:16:12 +03:00
8137609e2f docs: add dgruntz as a contributor (#1399)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:14:30 +03:00
e924c9399a docs: add hannespernpeintner as a contributor (#1398)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:12:47 +03:00
d791c78501 docs: add leogtzr as a contributor (#1397)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:11:09 +03:00
ba485e2c3e docs: add npczwh as a contributor (#1396)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:09:00 +03:00
be54dc1c7e docs: add oconnelc as a contributor (#1395)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:07:15 +03:00
ec80402fe5 docs: add giorgosmav21 as a contributor (#1394)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:05:22 +03:00
d1de465780 docs: add hbothra15 as a contributor (#1393)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:02:13 +03:00
c2fb591749 docs: add igeligel as a contributor (#1392)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 18:00:07 +03:00
c5479cc882 docs: add llorllale as a contributor (#1391)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:58:00 +03:00
7968615ad4 docs: add mookkiah as a contributor (#1390)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:55:53 +03:00
c0d7c8922e docs: add Azureyjt as a contributor (#1388)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:53:30 +03:00
5a23fab795 docs: add vehpsr as a contributor (#1389)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:50:53 +03:00
8c21809dad docs: add ThatGuyWithTheHat as a contributor (#1387)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:49:00 +03:00
37bffb4a99 docs: add gopinath-langote as a contributor (#1386)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:47:06 +03:00
8182405796 docs: add hoswey as a contributor (#1385)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:44:05 +03:00
39e5436ed5 docs: add amit2103 as a contributor (#1384)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:41:35 +03:00
8d6791490b docs: add gwildor28 as a contributor (#1383)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:39:11 +03:00
eb8ddde98f docs: add llitfkitfk as a contributor (#1382)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-29 17:36:32 +03:00
0358fcec4c update readme 2020-07-28 20:53:31 +03:00
023865ad4c docs: add pitsios-s as a contributor (#1381)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-28 20:45:59 +03:00
60ab9fa3ce docs: add qza as a contributor (#1380)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-28 20:43:09 +03:00
f85e4db0be docs: add Tschis as a contributor (#1379)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-28 20:40:11 +03:00
2b095bec28 docs: add ankurkaushal as a contributor (#1378)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-28 20:37:11 +03:00
cfba28f9a4 docs: add okinskas as a contributor (#1377)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <ilkka.seppala@gofore.com>
2020-07-28 20:33:05 +03:00
c0d2c7fdb0 docs: add robertt240 as a contributor (#1376)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 20:23:30 +03:00
96344142e9 docs: add sideris as a contributor (#1375)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:52:31 +03:00
0bc3756250 update all-contributors config 2020-07-28 18:49:46 +03:00
d94199f5ff update readme 2020-07-28 18:23:47 +03:00
b805a7526e docs: add SrdjanPaunovic as a contributor (#1374)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:17:42 +03:00
0cff538c27 docs: add gvsharma as a contributor (#1373)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:16:14 +03:00
452981669b docs: add kapinuss as a contributor (#1372)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:14:37 +03:00
2706c8fc37 docs: add qpi as a contributor (#1371)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:13:03 +03:00
03ebd5f353 docs: add yusufaytas as a contributor (#1370)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:11:29 +03:00
5b269d5af1 docs: add 4lexis as a contributor (#1369)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:09:43 +03:00
0563ac7645 docs: add bernardosulzbach as a contributor (#1368)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:08:01 +03:00
a5ff32c13e docs: add dheeraj-mummareddy as a contributor (#1367)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 18:02:49 +03:00
97adc13a1b docs: add JuhoKang as a contributor (#1366)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:57:26 +03:00
d8f12529f2 docs: add ruslanpa as a contributor (#1365)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:55:47 +03:00
4c766b9e71 docs: add colinbut as a contributor (#1364)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:52:39 +03:00
c85d764e39 docs: add nikhilbarar as a contributor (#1363)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:50:39 +03:00
f360b64877 docs: add saksham93 as a contributor (#1362)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:48:50 +03:00
a77e9620b5 docs: add TylerMcConville as a contributor (#1361)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:46:41 +03:00
cf8e366e25 docs: add Argyro-Sioziou as a contributor (#1360)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:44:46 +03:00
80605283f5 docs: add kemitix as a contributor (#1359)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:42:27 +03:00
8ba111fe60 docs: add zafarella as a contributor (#1358)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:40:28 +03:00
1cb9c2bcde docs: add Crossy147 as a contributor (#1357)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:37:56 +03:00
d6edeee326 docs: add joshzambales as a contributor (#1356)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:35:49 +03:00
781a7c8b52 docs: add piyushchaudhari04 as a contributor (#1355)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:32:58 +03:00
960adfc37a docs: add inbravo as a contributor (#1354)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:30:42 +03:00
b3eb6ccea4 docs: add isabiq as a contributor (#1353)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:28:35 +03:00
d609f3eec6 docs: add markusmo3 as a contributor (#1352)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-28 17:26:03 +03:00
09dd0bee30 docs: add anuragagarwal561994 as a contributor (#1351)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 23:20:44 +03:00
64eff5eb93 docs: add thomasoss as a contributor (#1350)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 23:18:02 +03:00
05dfd31fb7 docs: add mikulucky as a contributor (#1349)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 23:14:34 +03:00
2c8535e839 max 3 contribution types per person 2020-07-27 23:07:58 +03:00
aea90ab115 docs: add fluxw42 as a contributor (#1348)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 22:48:15 +03:00
211d7903ae docs: add npathai as a contributor (#1347)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 22:40:20 +03:00
02b6aba6ae fix config syntax 2020-07-27 22:38:07 +03:00
76f634ff7a docs: add iluwatar as a contributor (#1346)
* docs: update README.md [skip ci]

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

* docs: update README.md [skip ci]

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

* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
2020-07-27 21:50:31 +03:00
ae7a0b8a4a docs: add amit1307 as a contributor (#1345)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 21:17:52 +03:00
b7d122f614 docs: add iluwatar as a contributor (#1344)
* docs: update README.md [skip ci]

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

* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
2020-07-27 21:13:13 +03:00
93c11fdf23 Update README.md 2020-07-27 21:01:48 +03:00
ef4de30310 docs: add iluwatar as a contributor (#1343)
* docs: update README.md [skip ci]

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

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-07-27 20:59:08 +03:00
b62bed7e43 #590 explanation for Promise 2020-07-27 18:28:12 +03:00
54c0b1725c Fix broken logging in service layer (#1342) 2020-07-27 16:50:32 +03:00
4b88214bae Fix syntax 2020-07-26 22:47:33 +03:00
eee409f284 Fix syntax 2020-07-26 22:44:54 +03:00
2fdd7a11e9 SonarQube check runs only in master branch (workaround for https://jira.sonarsource.com/browse/MMF-1371) 2020-07-26 22:40:42 +03:00
f37d697a60 #590 explanation for Service Layer 2020-07-26 19:25:25 +03:00
3e1a83e29d #590 explanation for API Gateway 2020-07-26 15:53:48 +03:00
0a35cdfbe4 #590 explanation for Unit of Work 2020-07-26 12:10:48 +03:00
1eafb46b61 Update links and tags 2020-07-26 11:30:42 +03:00
2ee5789c77 #590 explanation for Trampoline 2020-07-25 15:48:21 +03:00
d9ed8a52b5 Update readme 2020-07-25 14:28:43 +03:00
205b87cd93 Improve Prototype description 2020-07-24 16:45:28 +03:00
689486267d #590 add explanation to Pipeline 2020-07-23 18:53:47 +03:00
9deb587c52 #590 add explanation for Fluent Interface 2020-07-23 18:27:00 +03:00
645fb20730 #590 improve Retry explanation 2020-07-23 17:50:20 +03:00
1886a6f969 #590 add explanation for Game Loop 2020-07-22 21:34:44 +03:00
9db997d0ae #590 add explanation for Thread Pool 2020-07-22 20:59:14 +03:00
8982392fea #590 add explanation for Throttling 2020-07-22 20:31:56 +03:00
082d63a1b3 #590 add explanation for Tolerant Reader 2020-07-21 22:57:11 +03:00
6c21143303 #590 add explanation for Dependency Injection 2020-07-21 20:04:06 +03:00
172964e75c #590 explanation for Template Method 2020-07-20 20:23:39 +03:00
ab4e53a468 #590 add explanation for State 2020-07-20 20:06:39 +03:00
b907a2a9bc #590 add explanation for Memento 2020-07-20 17:52:44 +03:00
467f647ca2 #590 add explanation for Repository 2020-07-20 17:31:58 +03:00
a18c0f76ea #590 add explanation for Poison Pill 2020-07-19 20:23:12 +03:00
e34de39ae7 #590 explanation for Null Object 2020-07-19 19:53:31 +03:00
4d95d38b8d #590 explanation for Multiton 2020-07-19 19:37:40 +03:00
d2724e8091 #590 add explanation for Strategy 2020-07-19 17:34:58 +03:00
9a81ddb7d8 #590 add explanation for Observer 2020-07-19 17:14:02 +03:00
61dfa50822 #590 add explanation for Execute Around 2020-07-18 17:43:12 +03:00
09cee8ffa7 #590 add explanation for DTO 2020-07-18 17:10:50 +03:00
5aacdecc6c #590 add explanation for Callback 2020-07-18 11:25:49 +03:00
eeea3c7b1f #590 add explanation for Object Pool 2020-07-18 10:51:02 +03:00
76fb9aff8b #590 add explanation for Dao 2020-07-18 10:22:43 +03:00
68fa6f451b #590 add explanation for Visitor 2020-07-16 20:46:00 +03:00
e98ad671e9 #590 add explanation for Iterator pattern 2020-07-15 20:06:58 +03:00
4264f52d49 #590 add explanation for Command pattern 2020-07-15 11:03:23 +03:00
ee654cf7b2 Add references to Enterprise Integration Patterns 2020-07-07 21:23:04 +03:00
51f6282e9b Add references to Patterns of Enterprise Application Architecture 2020-07-07 21:19:14 +03:00
2212690468 Add references to J2EE Design Patterns book 2020-07-07 20:05:35 +03:00
4beb53b8b8 Add references to Refactoring to Patterns book 2020-07-07 18:44:00 +03:00
0b1a98137a Add links to Head First Design Patterns book 2020-07-07 18:05:11 +03:00
bd1dbec19f Translate README.md via GitLocalize (#1259)
Co-authored-by: xiaod-dev <657829312@qq.com>
2020-07-07 21:17:11 +08:00
a3564a8847 Update links 2020-07-06 13:31:07 +03:00
9e30383eb6 Update license and puml 2020-07-04 12:20:54 +03:00
6fe219d644 Pr/1235 Review (#1250)
* Add simple implementation for strangler pattern.

* Add strangler pattern in pom.xml.

* change package name

* Revert "change package name"

This reverts commit 430bd9073e.

* Code review for strangler

Delete final of method parameters.
Add final to private members.
Change package name.

* Revert "Code review for strangler"

This reverts commit d506356708.

* Revert "Revert "Code review for strangler""

This reverts commit c8fd65fda7.

* Remove unnecessary files
2020-07-04 12:05:46 +03:00
5192beb5dd Re-add gh access token 2020-06-14 22:36:47 +03:00
f4f9c1a441 Remove gh token 2020-06-14 22:15:13 +03:00
a396d972f6 Add sonar modulekey 2020-06-14 21:54:47 +03:00
30678792fd Remove extra project key 2020-06-14 21:23:07 +03:00
cfa2b35bff Fix syntax 2020-06-14 21:04:09 +03:00
5db8037b8b Add SonarCloud analysis 2020-06-14 21:02:40 +03:00
71affacee2 Remove update website script 2020-06-14 20:19:35 +03:00
371263d1b3 Fix xvfb setup 2020-06-14 18:45:01 +03:00
0b41aaaa76 Fix syntax 2020-06-14 18:37:29 +03:00
f28a63a46c Use GabrielBB/xvfb-action 2020-06-14 18:33:48 +03:00
3ea65e06bc Install xvfb before building 2020-06-14 18:23:25 +03:00
1aea35f8e5 Update build status badge 2020-06-14 17:48:42 +03:00
0f751d40cb Fix checkstyle error 2020-06-14 17:36:26 +03:00
92ecd63ccf Add Github Actions workflow 2020-06-14 17:27:43 +03:00
3033e4c9fc Improve lazy loaded Singleton example 2020-06-10 18:10:34 +03:00
e68beb40ec Fix typo for leader-election pattern description (#1239) 2020-05-31 10:47:14 +03:00
a3c4d36c3d Added Java 11 support and created constants in App.java (#1238)
Co-authored-by: cherukumilliv <VenkatRamaSubbarago.Cherukumilli@Cevalogistics.com>
2020-05-31 10:45:28 +03:00
1c26bd7416 Fix issue #1218: Arrange, Act, Assert pattern (#1221)
* add AAA pattern

* reformat comment

* use Testing in readme tags in stead of Unit Test
2020-05-17 21:44:53 +03:00
845da1fa16 add java 11 support (o) (#1222) 2020-04-26 15:06:09 +03:00
751b3b9452 Changing Aggregator Microservices pattern link (#1214)
Page doesn't exist anymore, so changed to use web archive
2020-03-28 20:26:37 +02:00
be1c0b8143 Fix issue #179: Leader Followers Pattern (#1189)
* add leader followers pattern

* use var and streams instead in App::execute

* use logger instead of printing to system output stream
2020-03-26 21:14:44 +02:00
6ce33ed6df Arranged following design patterns into modules: (#1210)
1. Factory Method
2. Feature Toggle
2020-03-26 21:04:11 +02:00
a4be693de6 Arranged design patterns into modules: (#1209)
1. Facade
2. Factory Kit
2020-03-26 21:03:10 +02:00
80519379f1 Organisation of design patterns into modules (#1208)
1. Event Asynchoronous
2. Execute Around
2020-03-25 21:27:41 +02:00
95bef5f0e8 Bump slf4j-test from 1.0.0 to 1.2.0 (#1204)
Bumps slf4j-test from 1.0.0 to 1.2.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-25 21:03:42 +02:00
d429865c54 Bump mockito-all from 1.9.5 to 1.10.19 (#1202)
Bumps [mockito-all](https://github.com/mockito/mockito) from 1.9.5 to 1.10.19.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v1.9.5...v1.10.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-25 21:00:51 +02:00
37a34ae174 Remove lombok dependency 2020-03-25 20:51:23 +02:00
67edeb806d Java 11 support for #984 #987 (l) (#1190)
* Java 11 support: lazy-loading pattern

* Java 11 support: layers pattern

* Java 11 support: leader-election/lazy-loading patterns
2020-03-22 20:02:45 +02:00
0ad67c8726 Use HTTPS instead of HTTP to resolve dependencies (#1184)
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2020-03-12 20:37:36 +02:00
a410004a8f Organisation of design patterns into modules: (#1188)
1. EIP Publish Channel
2. Event Aggregator
2020-03-07 11:53:19 +00:00
16ef70bfdc Organisation of patterns into modules: (#1187)
1. Double DIspatch
2. EIP Message Channel
2020-03-07 11:50:51 +00:00
6bf3a13064 Import of design patterns into modules: (#1186)
1. DIrty flag
2. Double checked locking
2020-03-07 11:48:25 +00:00
54db4497a3 Organised the below patterns into modules: (#1185)
1. Decorator
2. Delegation
2020-03-07 11:47:24 +00:00
eaf3598807 Organised below design patterns into modules: (#1183)
1. Data Mapper
2. Data Transfer Object
2020-03-07 11:24:31 +00:00
4e01ca39fd Organised below design patterns into modules: (#1182)
1. Converter
2. Dao
2020-03-07 11:22:55 +00:00
1c558ff4c5 Organised below design patterns into modules: (#1181)
1. Command
2. Composite
2020-03-07 11:20:44 +00:00
33e4a870ca Fix imperative-style. (#1180)
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
2020-03-07 11:12:06 +00:00
33682ad3e8 Modularisation for design patterns: (#1179)
1. Chain
2. Collection-Pipeline
2020-02-16 21:02:40 +02:00
2d6c372f21 Modularisation for 2 patterns: (#1178)
1. Business-delegate
2, Callback
2020-02-08 10:36:51 +02:00
f2bb46f9b4 Modularization for 2 more modules (#1177)
1. Abstract Factory
2. Acyclic Visitor
2020-02-05 07:14:27 +02:00
81cc85a9cd Bump mongodb-driver from 3.12.0 to 3.12.1 (#1173)
Bumps [mongodb-driver](https://github.com/mongodb/mongo-java-driver) from 3.12.0 to 3.12.1.
- [Release notes](https://github.com/mongodb/mongo-java-driver/releases)
- [Commits](https://github.com/mongodb/mongo-java-driver/compare/r3.12.0...r3.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-01 08:55:06 +02:00
f942bfa51c Bump javassist from 3.25.0-GA to 3.26.0-GA (#1170)
Bumps [javassist](https://github.com/jboss-javassist/javassist) from 3.25.0-GA to 3.26.0-GA.
- [Release notes](https://github.com/jboss-javassist/javassist/releases)
- [Commits](https://github.com/jboss-javassist/javassist/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-01 08:52:38 +02:00
d2fdd7d82b Bump mongo-java-driver from 3.12.0 to 3.12.1 (#1169)
Bumps [mongo-java-driver](https://github.com/mongodb/mongo-java-driver) from 3.12.0 to 3.12.1.
- [Release notes](https://github.com/mongodb/mongo-java-driver/releases)
- [Commits](https://github.com/mongodb/mongo-java-driver/compare/r3.12.0...r3.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-01 08:51:21 +02:00
365c74ddde Bump slf4j-api from 1.7.28 to 1.7.30 (#1153)
Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.28 to 1.7.30.
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.28...v_1.7.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 17:13:50 +02:00
728de1bb34 Bump gson from 2.8.1 to 2.8.6 (#1147)
Bumps [gson](https://github.com/google/gson) from 2.8.1 to 2.8.6.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.1...gson-parent-2.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-18 21:02:56 +02:00
428efc7d53 Java 11 migrate remaining p (#1122)
* Moves partial-response to Java 11

* Moves pipeline to Java 11

* Moves poison-pill to Java 11

* Moves priority-queue to Java 11

* Moves private-class-data to Java 11

* Moves producer-consumer to Java 11

* Moves promise to Java 11

* Moves property to Java 11

* Moves prototype to Java 11

* Moves proxy to Java 11

* Corrects checkstyle errors

* Fixes build for pipeline pattern
2020-01-16 08:06:36 +02:00
1401accb4f Revert "Bump maven-surefire-plugin from 3.0.0-M3 to 3.0.0-M4 (#1126)"
This reverts commit f00523f7c0.
2020-01-12 11:00:23 +02:00
6dba5b9b58 Bump mongodb-driver from 3.0.4 to 3.12.0 (#1135)
Bumps [mongodb-driver](https://github.com/mongodb/mongo-java-driver) from 3.0.4 to 3.12.0.
- [Release notes](https://github.com/mongodb/mongo-java-driver/releases)
- [Commits](https://github.com/mongodb/mongo-java-driver/compare/r3.0.4...r3.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-11 10:09:56 +02:00
1ffb28ba4f [Security] Bump jackson.version from 2.8.5 to 2.10.2 (#1133)
Bumps `jackson.version` from 2.8.5 to 2.10.2.

Updates `jackson-core` from 2.8.5 to 2.10.2
- [Release notes](https://github.com/FasterXML/jackson-core/releases)
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.8.5...jackson-core-2.10.2)

Updates `jackson-databind` from 2.8.5 to 2.10.2
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `jackson-annotations` from 2.8.5 to 2.10.2
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-11 10:06:45 +02:00
c7c8940c5a Abstract document add module info file (#1118)
* Added module-info.java file in abstract document pattern

* Renamed module name and added the required module.
2020-01-11 09:53:09 +02:00
e88ea8a870 Fix markdown (#1131) 2020-01-11 09:44:59 +02:00
8618ab64f6 Bump guava-testlib from 19.0 to 23.0 (#1130)
Bumps [guava-testlib](https://github.com/google/guava) from 19.0 to 23.0.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/compare/v19.0...v23.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-11 09:31:38 +02:00
f1471641b0 Revert "Bump maven-war-plugin from 2.4 to 3.2.3 (#1129)"
This reverts commit b99d37506f.
2020-01-09 11:23:24 +02:00
b99d37506f Bump maven-war-plugin from 2.4 to 3.2.3 (#1129)
Bumps [maven-war-plugin](https://github.com/apache/maven-war-plugin) from 2.4 to 3.2.3.
- [Release notes](https://github.com/apache/maven-war-plugin/releases)
- [Commits](https://github.com/apache/maven-war-plugin/compare/maven-war-plugin-2.4...maven-war-plugin-3.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-08 22:22:49 +02:00
6c545c93e5 Bump mongo-java-driver from 3.3.0 to 3.12.0 (#1127)
Bumps [mongo-java-driver](https://github.com/mongodb/mongo-java-driver) from 3.3.0 to 3.12.0.
- [Release notes](https://github.com/mongodb/mongo-java-driver/releases)
- [Commits](https://github.com/mongodb/mongo-java-driver/compare/r3.3.0...r3.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-08 22:17:59 +02:00
f00523f7c0 Bump maven-surefire-plugin from 3.0.0-M3 to 3.0.0-M4 (#1126)
Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M3 to 3.0.0-M4.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M3...surefire-3.0.0-M4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-08 22:16:54 +02:00
346cf0f793 LICENSE: Happy new year! (#1123)
* Update LICENSE.md

* Update LICENSE.md
2020-01-04 19:04:23 +02:00
20ea465b7f Java 11 migrate remaining q-r (#1121)
* Moves queue-load-leveling to Java 11

* Moves reactor to Java 11

* Moves reader-writer-lock to Java 11

* Moves repository to Java 11

* Moves resource-acquisition-is-initialization to Java 11

* Moves retry to Java 11

* Moves role-object to Java 11
2020-01-04 18:43:12 +02:00
cd2a2e7711 Java 11 migrate all remaining s (#1120)
* Moves saga to Java 11

* Moves semaphore to Java 11

* Moves servant to Java 11

* Moves serverless to Java 11

* Moves service-layer to Java 11

* Moves service-locator to Java 11

* Moves sharding to Java 11

* Moves singleton to Java 11

* Moves spatial-partition to Java 11

* Moves specification to Java 11

* Moves state to Java 11

* Moves step-builder to Java 11

* Moves strategy to Java 11

* Moves subclass-sandbox to Java 11

* Fixes checkstyle issues
2020-01-04 18:36:08 +02:00
310ae50248 Issue 989 final-batch (#1119)
* Adding support for maven assembly plugin to generate executable jar with all dependencies in built

* Merge branch 'master' into issue-989

# Conflicts:
#	abstract-document/pom.xml
#	pom.xml

* Adding maven assemly plugin for projects with name A

* Update in format as per checkstyle, i.e. Spcae in place of tab with size of 2

* batch set - 2 having all project with B and C

* issue-989 d-e-f

* fixing eip pom and adding g-h-i-l-m-n Skipping naked object as it seems it doesn't have main method, will consider this at end

* Adding for O and P projects Skipping Object-Mother as we don't have main method for same.

* Final batch
2019-12-29 14:41:21 +02:00
670c4e43f3 Java 11 migrate 7 remaining f (#1115)
* Moves facade to Java 11

* Moves factory-kit to Java 11

* Moves factory-method to Java 11

* Moves feature-toggle to Java 11

* Moves fluentinterface to Java 11

* Moves flux to Java 11

* Moves flyweight to Java 11

* Moves front-controller to Java 11

* Uses stream properly

* Resolves issues with ci
2019-12-22 14:41:19 +02:00
f835d3d516 Java 11 migrate remaining (g,h,i) (#1116)
* Moves game-loop to Java 11

* Moves guarded-suspension to Java 11

* Moves half-sync-half-async to Java 11

* Moves hexagonal to Java 11

* Moves intercepting-filter to Java 11

* Moves interpreter to Java 11

* Moves iterator to Java 11
2019-12-20 07:11:30 +02:00
7d0a5c0edb Issue 989 batch-2 (#1108)
* Adding support for maven assembly plugin to generate executable jar with all dependencies in built

* Merge branch 'master' into issue-989

# Conflicts:
#	abstract-document/pom.xml
#	pom.xml

* Adding maven assemly plugin for projects with name A

* Update in format as per checkstyle, i.e. Spcae in place of tab with size of 2

* batch set - 2 having all project with B and C

* issue-989 d-e-f

* fixing eip pom and adding g-h-i-l-m-n Skipping naked object as it seems it doesn't have main method, will consider this at end

* Adding for O and P projects Skipping Object-Mother as we don't have main method for same.
2019-12-18 22:04:08 +02:00
ea57934db6 Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11

* Moves cqrs pattern to Java 11

* Moves dao pattern to Java 11

* Moves data-bus pattern to Java 11

* Moves data-locality pattern to Java 11

* Moves data-mapper pattern to Java 11

* Moves data-transfer-object pattern to Java 11

* Moves decorator pattern to Java 11

* Moves delegation pattern to Java 11

* Moves dependency-injection to Java 11

* Moves dirty-flag to Java 11

* Moves double-buffer to Java 11

* Moves double-checked-locking to Java 11

* Moves double-dispatch to Java 11

* Corrects with changes thats breaking test cases
2019-12-14 20:32:45 +02:00
5681684157 https://github.com/iluwatar/java-design-patterns-web/issues/8 Fix typo in tag 2019-12-13 22:22:11 +02:00
b2b1ba95eb https://github.com/iluwatar/java-design-patterns-web/issues/8 Update pattern categories and tags 2019-12-13 21:09:28 +02:00
0335c61512 Fix Acyclic Visitor readme layout 2019-12-13 09:36:57 +02:00
fb2c026822 Java 11 migrate remaining e (#1112)
* Moves eip-aggregator to Java 11

* Moves eip-message-channel to Java 11

* Moves eip-publish-subscribe to Java 11

* Moves eip-splitter to Java 11

* Moves eip-wire-tap to Java 11

* Moves event-aggregator to Java 11

* Moves event-asynchronous to Java 11

* Moves event-driven-architecture to Java 11

* Moves event-queue to Java 11

* Moves event-sourcing to Java 11

* Moves execute-around to Java 11

* Moves extension-objects to Java 11
2019-12-09 19:03:30 +02:00
b09b100614 #1113 Link uml-reverse-mapper created class diagrams to readme, where needed 2019-12-07 20:26:59 +02:00
0685a505d3 #1113 Add uml-reverse-mapper plugin 2019-12-07 18:03:49 +02:00
55769e9841 Update Method pattern (#1106)
* Add update method pattern

* Add unit tests

* Add README.md

* Resolve conflict
2019-12-01 15:06:19 +02:00
05e582ca3e Pattern combinator (#1105)
*  init

*  add pattern
2019-11-26 08:03:04 +02:00
a9c3df78ee Changes the description of the prototype pattern (#1102) 2019-11-19 21:57:20 +02:00
1fbe9bbac5 Changes the description of the template method pattern (as discussed in Issue1099) (#1101)
* Declares the template methods as final

* Extends the description of the template method pattern

* Removes the final declarations (this was done in another branch)
2019-11-19 21:49:07 +02:00
e0b728c5e2 Package patterns into executable jars setup (#1092)
* Adding support for maven assembly plugin to generate executable jar with all dependencies in built

* Merge branch 'master' into issue-989

# Conflicts:
#	abstract-document/pom.xml
#	pom.xml

* Adding maven assemly plugin for projects with name A

* Update in format as per checkstyle, i.e. Spcae in place of tab with size of 2
2019-11-19 21:37:19 +02:00
515b7e7134 Changes the implementation of the prototype pattern (#1103)
* Changes the implementation of the prototype pattern

* Fixes the checkstyle warnings

* Fixes additional checkstyle warnings
2019-11-19 09:34:24 +02:00
d4b2496e60 Update App.java (#1098) 2019-11-18 19:18:46 +02:00
7e4d0b4cdc Changes aggregation to composition (as described in issue #1095) (#1096) 2019-11-18 19:04:40 +02:00
8037495e04 Add some formatting to Specification pattern readme 2019-11-17 15:20:42 +02:00
6941e65cb4 Set version for next development iteration 2019-11-17 14:45:41 +02:00
7d845505b5 Java Design Patterns 1.22.0 2019-11-17 14:44:42 +02:00
73f9b8bef1 Adding composite specification (Issue#1093) (#1094)
* Resolution proposition to Issue#1055 (UML diagram left to do)

* Deciding not to modify the UML diagram for now

* Resolution proposition to Issue#1093

* Code reformatting
2019-11-17 14:25:32 +02:00
19b129c28e Fix several frontmatter issues 2019-11-16 21:56:40 +02:00
63c707fcb1 Add game-loop to parent pom.xml 2019-11-16 21:17:21 +02:00
cc4b990ae8 #590 Add explanation for Converter pattern 2019-11-16 21:06:05 +02:00
8747f1fd7a #1021 enforce Checkstyle rules in the build 2019-11-16 16:00:24 +02:00
9e58edf05e Merge branch 'master' of https://github.com/iluwatar/java-design-patterns 2019-11-16 14:56:36 +02:00
271d7ae9bd Resolves checkstyle errors for remaining p (#1091)
* Reduces checkstyle errors in page-object

* Reduces checkstyle errors in partial-response

* Reduces checkstyle errors in pipeline

* Reduces checkstyle errors in poison-pill

* Reduces checkstyle errors in priority-queue

* Reduces checkstyle errors in private-class-data

* Reduces checkstyle errors in property

* Reduces checkstyle errors in prototype

* Reduces checkstyle errors in proxy
2019-11-16 14:56:26 +02:00
26f4aa8001 Merge branch 'master' of https://github.com/iluwatar/java-design-patterns 2019-11-16 14:48:43 +02:00
1fdc650545 Resolves checkstyle errors for remaining m (#1090)
* Reduces checkstyle errors in marker

* Reduces checkstyle errors in master-worker-pattern

* Reduces checkstyle errors in mediator

* Reduces checkstyle errors in memento

* Reduces checkstyle errors in model-view-controller

* Reduces checkstyle errors in model-view-presenter

* Reduces checkstyle errors in module

* Reduces checkstyle errors in monad

* Reduces checkstyle errors in monostate

* Reduces checkstyle errors in multiton

* Reduces checkstyle errors in mute-idiom

* Reduces checkstyle errors in mutex
2019-11-16 14:48:23 +02:00
3ccc9baa1a Game Loop Pattern (#1083)
* Add game loop module

* Add game loop module

* Fix merge issue

* Implement game loop module

* Implement game loop module

* Implement time based game loop

* implement VariableStepGameLoop

* Implement FixedStepGameLoop

* Add UT

* Add Unit tests

* Fix checkstyle issues

* Add README.md

* Fix code review issues

* Fix code review issues

* update README.md
2019-11-16 14:40:23 +02:00
df8a4e3b47 Adding parameterized specification (Issue#1055) (#1088)
* Resolution proposition to Issue#1055 (UML diagram left to do)

* Deciding not to modify the UML diagram for now
2019-11-16 14:24:46 +02:00
cc571f4149 Saga pattern (#1062)
* init repo for role object

* add to init

*  add to init

*  add first impl

*  add pattern

*  add license

*  add changes

*  add saga init dsc

* add init saga dsc

*  add changes to dsc

*  add

*  add orchestrator

*  add ch

* separate pkgs

*  add info

*  add choreogr

*  rem space

*  change according to cgeckstyle

*  add changes according to google style
2019-11-14 08:03:50 +02:00
51b444dccf Merge branch 'master' of https://github.com/besok/java-design-patterns 2019-11-14 08:02:05 +02:00
50467c9e76 Java 11 migration: patterns (t-v) (#1085)
* Moves visitor pattern to java 11

* Moves value-object pattern to java 11

* Moves unit-of-work pattern to java 11

* Moves typeobjectpattern pattern to java 11

* Moves twin pattern to java 11

* Moves trampoline pattern to java 11

* Moves tolerant-reader pattern to java 11

* Moves tls pattern to java 11

* Moves throttling pattern to java 11

* Moves thread-pool pattern to java 11

* Moves template-method pattern to java 11
2019-11-14 07:42:05 +02:00
87af122509 add changes according to google style 2019-11-13 21:01:10 +00:00
160b737dcc Add another real world example for Builder 2019-11-13 18:16:50 +02:00
f04fc3c0dc Java 11 migration: patterns starting with a (#1084)
* Moves abstract-factory pattern to java 11

* Moves abstract-document pattern to java 11

* Moves acyclic-visitor pattern to java 11

* Moves adapter pattern to java 11

* Moves aggregator-microservices pattern to java 11

* Moves api-gateway pattern to java 11
2019-11-13 18:04:51 +02:00
3c57bf7078 #984 #987 update readmes 2019-11-12 22:12:47 +02:00
33ea7335b1 Java 11 migration: patterns (remaining b-c) (#1081)
* Moves business-delegate pattern  to java 11

* Moves bytecode pattern  to java 11

* Moves caching pattern  to java 11

* Moves callback pattern  to java 11

* Moves chain pattern  to java 11

* Moves circuit-breaker pattern  to java 11

* Moves collection-pipeline pattern  to java 11

* Moves command pattern  to java 11

* Moves commander pattern  to java 11

* Moves composite pattern  to java 11

* Corrects test cases
2019-11-12 21:56:46 +02:00
6ef840f3cf Resolves checkstyle errors for naked-objects null-object object-mother object-pool observer queue-load-leveling (#1082)
* Reduces checkstyle errors in naked-objects

* Reduces checkstyle errors in null-object

* Reduces checkstyle errors in object-mother

* Reduces checkstyle errors in object-pool

* Reduces checkstyle errors in observer

* Reduces checkstyle errors in queue-load-leveling
2019-11-12 21:26:15 +02:00
1e76d91929 Resolves checkstyle errors for abstract-document abstract-factory acyclic-visitor adapter aggregator-microservices (#1080)
* Reduces checkstyle errors in abstract-document

* Reduces checkstyle errors in abstract-factory

* Reduces checkstyle errors in acyclic-visitor

* Reduces checkstyle errors in adapter

* Reduces checkstyle errors in aggregator-microservices
2019-11-11 22:30:08 +02:00
390795154f Resolves checkstyle issues for semaphore servant serverless service-layer service-locator (#1079)
* Reduces checkstyle errors in semaphore

* Reduces checkstyle errors in servant

* Reduces checkstyle errors in serverless

* Reduces checkstyle errors in service-layer

* Reduces checkstyle errors in service-locator
2019-11-11 22:27:43 +02:00
37599eb48f Resolves checkstyle errors for feature-toggle fluentinterface flux flyweight front-controller (#1078)
* Reduces checkstyle errors in feature-toggle

* Reduces checkstyle errors in fluentinterface

* Reduces checkstyle errors in flux

* Reduces checkstyle errors in flyweight

* Reduces checkstyle errors in front-controller
2019-11-11 22:24:23 +02:00
c954a436ad Resolves checkstyle errors for facade factory-kit spatial-partition state step-builder (#1077)
* Reduces checkstyle errors in facade

* Reduces checkstyle errors in factory-kit

* Reduces checkstyle errors in spatial-partition

* Reduces checkstyle errors in state

* Reduces checkstyle errors in step-builder
2019-11-11 22:21:12 +02:00
2628cc0dfc #984 update Builder readme 2019-11-11 22:10:31 +02:00
0272d71851 #984 update Bridge readme 2019-11-11 22:07:54 +02:00
329479dda0 #984 update Ambassador readme 2019-11-11 22:03:44 +02:00
c4418311c6 Java 11 migration: ambassador async-method-invocation balking bridge builder (#1076)
* Moves ambassador pattern to java 11

* Moves async-method-invocation pattern  to java 11

* Moves balking pattern  to java 11

* Moves bridge pattern  to java 11

* Moves builder pattern  to java 11
2019-11-11 21:47:09 +02:00
f0f0143d48 Resolves checkstyle errors for trampoline twin typeobjectpattern unit-of-work value-object (#1074)
* Reduces checkstyle errors in trampoline

* Reduces checkstyle errors in twin

* Reduces checkstyle errors in typeobjectpattern

* Reduces checkstyle errors in unit-of-work

* Reduces checkstyle errors in value-object
2019-11-10 19:47:32 +02:00
b92eb5229d Resolves checkstyle errors for template-method thread-pool throttling tls tolerant-reader (#1073)
* Reduces checkstyle errors in template-method

* Reduces checkstyle errors in thread-pool

* Reduces checkstyle errors in throttling

* Reduces checkstyle errors in tls

* Reduces checkstyle errors in tolerant-reader
2019-11-10 19:45:17 +02:00
9c8ad4485b Resolves checkstyle errors for patterns starting with letter r (#1072)
* Reduces checkstyle errors in reactor

* Reduces checkstyle errors in reader-writer-lock

* Reduces checkstyle errors in repository

* Reduces checkstyle errors in resource-acquisition-is-initialization

* Reduces checkstyle errors in retry
2019-11-10 19:42:26 +02:00
4dae1fae57 Resolves checkstyle errors for execute-around extension-objects (#1071)
* Reduces checkstyle errors in execute-around

* Reduces checkstyle errors in extension-objects
2019-11-10 19:38:51 +02:00
5ae2ce6e2e Resolves checkstyle errors for event-* (#1070)
* Reduces checkstyle errors in event-aggregator

* Reduces checkstyle errors in event-asynchronous

* Reduces checkstyle errors in event-driven-architecture

* Reduces checkstyle errors in event-queue

* Reduces checkstyle errors in event-sourcing
2019-11-10 19:37:10 +02:00
7c888e8886 Resolves checkstyle errors for eip-* (#1069)
* Reduces checkstyle errors in eip-aggregator

* Reduces checkstyle errors in eip-message-channel

* Reduces checkstyle errors in eip-publish-subscribe

* Reduces checkstyle errors in eip-splitter

* Reduces checkstyle errors in eip-wire-tap
2019-11-10 19:34:42 +02:00
f2c91eb836 Resolves checkstyle errors for delegation dependency-injection dirty-flag double-buffer double-checked-locking double-dispatch (#1068)
* Reduces checkstyle errors in delegation

* Reduces checkstyle errors in dependency-injection

* Reduces checkstyle errors in dirty-flag

* Reduces checkstyle errors in double-buffer

* Reduces checkstyle errors in double-checked-locking

* Reduces checkstyle errors in double-dispatch
2019-11-10 19:31:19 +02:00
01e489c77b Resolves checkstyle errors for dao data-bus data-locality data-mapper data-transfer-object decorator (#1067)
* Reduces checkstyle errors in dao

* Reduces checkstyle errors in data-bus

* Reduces checkstyle errors in data-locality

* Reduces checkstyle errors in data-mapper

* Reduces checkstyle errors in data-transfer-object

* Reduces checkstyle errors in decorator
2019-11-10 19:27:09 +02:00
eae09fc07e Resolves checkstyle errors for api-gateway, lazy-loading, leader-election (#1066)
* Reduces checkstyle errors in lazy-loading

* Reduces checkstyle errors in leader-election

* Reduces checkstyle errors in api-gateway
2019-11-10 19:13:40 +02:00
7f06f3b78c Resolves checkstyle errors for intercepting-filter, interpreter, iterator (#1065)
* Reduces checkstyle errors in intercepting-filter

* Reduces checkstyle errors in interpreter

* Reduces checkstyle errors in iterator
2019-11-10 19:05:05 +02:00
dda09535e6 Resolves checkstyle errors for guarded-suspension, half-sync-half-async, hexagonal (#1064)
* Reduces checkstyle errors in guarded-suspension

* Reduces checkstyle errors in half-sync-half-async

* Reduces checkstyle errors in hexagonal
2019-11-10 19:01:32 +02:00
4f9ee0189c Resolves checkstyle errors for converter, cqrs (#1063)
* Reduces checkstyle errors in converter

* Reduces checkstyle errors in cqrs
2019-11-10 18:39:27 +02:00
de56cbb971 change according to cgeckstyle 2019-11-10 13:09:54 +00:00
2f49648047 Resolves checkstyle errors for collection-pipeline, command, commander (#1061)
* Reduces checkstyle errors in collection-pipeline

* Reduces checkstyle errors in command

* Reduces checkstyle errors in commander
2019-11-09 21:35:15 +02:00
31f27a720b Resolves checkstyle errors for callback, chain, circuit-breaker (#1060)
* Reduces checkstyle errors in callback

* Reduces checkstyle errors in chain

* Reduces checkstyle errors in circuit-breaker
2019-11-09 21:27:14 +02:00
efc17fcc70 Resolves checkstyle errors for business-delegate, bytecode, caching (#1059)
* Reduces checkstyle errors in business-delegate

* Reduces checkstyle errors in bytecode

* Reduces checkstyle errors in caching
2019-11-09 21:23:12 +02:00
6d1c0b1563 Resolves checkstyle errors for ambassador, async-method-invocation, balking, bridge, builder (#1058)
* Decreases checkstyle errors for ambassador pattern

* Reduces checkstyle errors in async-method-invocation

* Reduces checkstyle errors in balking

* Reduces checkstyle errors in bridge

* Reduces checkstyle errors in builder
2019-11-09 21:03:22 +02:00
74c7273381 rem space 2019-11-09 18:57:31 +00:00
8f85353baf merge changes 2019-11-09 17:56:15 +00:00
09b4663b9a add choreogr 2019-11-09 17:42:49 +00:00
1fa8a604eb Sharding Pattern (#1056)
* Create sharding module

* Add Unit Tests

* Fix readme hyperlink

* Fix check-style issue
2019-11-08 08:20:32 +02:00
50986fa15b #590 arrange Layers into packages and add explanation 2019-11-05 20:07:50 +02:00
8ecdee44c8 #1021 Checkstyle fixes for Layers 2019-11-05 17:38:05 +02:00
47ae477a56 #1021 Checkstyle changes for Factory Method 2019-11-05 17:28:08 +02:00
7dc47da131 #1021 Checkstyle fixes for Composite pattern 2019-11-05 17:22:53 +02:00
fbcfeb072a add info 2019-11-03 12:52:38 +00:00
ffeee2f1a4 separate pkgs 2019-11-03 12:35:01 +00:00
1b32e23493 add ch 2019-11-03 12:03:33 +00:00
3a4677c56d add orchestrator 2019-11-02 20:52:59 +00:00
c4c37d77e9 add 2019-11-02 14:45:05 +00:00
0b17abdf11 #590 Add explanation for Specification pattern 2019-11-02 14:45:50 +02:00
7ac47b291d add changes to dsc 2019-11-02 11:39:02 +00:00
564cf1239f add init saga dsc 2019-11-02 11:30:41 +00:00
768e647108 add saga init dsc 2019-11-02 11:29:52 +00:00
a8c7771784 #1021 style changes for Specification 2019-11-01 20:23:01 +02:00
1d4a7681e2 Fix for Issue #549 : Add Fallbacks in Aggregator Service (#971)
*  Fix for Issue##549

Catch ClientProtocolException and Update Error Logs

* Fix indentation, checkstyle errors

* Fix for Issue #549
Add fallbacks in Aggregator service when other microservices fail

* Make ProductInventoryClientImpl return null instead of zero in case of failure
2019-11-01 20:01:30 +02:00
55b0341c8d Fix remaining Checkstyle errors for Singleton 2019-10-31 20:01:39 +02:00
3b1a28149b decrease number of checkstyle errors in singleton, strategy and visitor patterns #1021 (#1054)
* fix checkstlye errors - visitor pattern

* fix checkstlye errors - strategy pattern

* fix checkstlye errors - singleton pattern
2019-10-31 19:54:13 +02:00
1eb1961f1b Remove presentations 2019-10-30 21:12:10 +02:00
cc85c73fbc Move faq.md to java-design-patterns-web repository 2019-10-30 19:52:25 +02:00
cdb80b8ddd Issue 893 (#1014)
* Using static object to reduce memory foot prints

* Updating README along with name of static fields

* Updating code as per review comments

* Updating code as per review comments

* Updating doc as per new code
2019-10-30 08:27:24 +02:00
a9dfd7e809 Update license header 2019-10-30 08:23:45 +02:00
fca7e9c8c7 https://github.com/iluwatar/java-design-patterns/issues/1021 - decrease number of checkstyle errors in callback pattern (#1053) 2019-10-30 08:19:33 +02:00
91a085d3d1 Update script 2019-10-30 08:15:43 +02:00
ff52848481 Update script 2019-10-29 23:28:05 +02:00
ccc1a6340b Update script 2019-10-29 23:02:24 +02:00
a65a601835 Update web site logic 2019-10-29 22:11:27 +02:00
c8a481bb77 Add java 11 support for #987 (o-t) (#1051)
* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
2019-10-29 08:37:40 +02:00
dd971d8c19 Use java 11 (#1050) 2019-10-28 17:02:17 +02:00
6bb3438965 Add java 11 (#1049) 2019-10-27 22:08:09 +02:00
63fb8dc318 Add java 11 (#1048) 2019-10-27 22:05:10 +02:00
b50189e283 Fix Role Object front matter 2019-10-26 21:26:42 +03:00
9f7e3fe552 Update license headers 2019-10-26 21:09:19 +03:00
d1767bbb51 The pattern Role object (#1031)
* init repo for role object

* add to init

*  add to init

*  add first impl

*  add pattern

*  add license

*  add changes
2019-10-26 20:58:40 +03:00
5d47488fe9 Fix error when building from a submodule directory (#1045)
Add directory-maven-plugin to resolve the location of the
license-plugin-header-style.xml from a submodule directory
2019-10-26 20:43:28 +03:00
d01a3a66b4 Update Github token 2019-10-26 20:32:50 +03:00
e3827945c8 add changes 2019-10-26 18:28:20 +01:00
fadad43f8b #984 for unitofwork, tolerantreader, twin (#1044)
* #984 for unitofwork, tolerantreader, twin

* #984 for unitofwork, tolerantreader, twin

* #987 for visitor, value-object, unitofwork, typeobjectpattern, tolerantreader, twin, tranpoline
2019-10-26 18:58:56 +03:00
c7fee7bb07 local variable type inference changes (#1042)
* local variable type inference changes

local variable type inference changes for thread pool design pattern

* local variable type inference changes

local variable type inference changes for ThreadPool design pattern
2019-10-26 18:50:47 +03:00
954e7300e9 local variable type inference changes (#1043)
local variable type inference changes for throttling design pattern
2019-10-26 18:49:28 +03:00
03e1e92b52 local variable type inference changes (#1041)
local variable type inference changes for template method design pattern
2019-10-26 18:47:43 +03:00
af8c5ed0dd local variable type inference changes (#1040)
local variable type inference changes for strategy design pattern
2019-10-26 18:45:54 +03:00
349d8edebf local variable type inference changes (#1039)
local variable type inference changes for step builder design pattern
2019-10-26 18:43:52 +03:00
12f13a631e local variable infere changes (#1038)
local variable infere changes for STATE design pattern
2019-10-26 18:41:39 +03:00
0b8d78e4bf local variable type inference changes (#1036)
local variable type inference changes for design pattern singleton
2019-10-26 18:40:14 +03:00
58d8fa1758 local variable type inference changes (#1035)
local variable type inference changes for design pattern service locator
2019-10-26 18:38:09 +03:00
f7a53f2d17 service-layer local type inference changes (#1034)
local variable type inference for service-layer design patterns
2019-10-26 18:35:32 +03:00
70ddeaa194 Create FUNDING.yml 2019-10-26 15:12:05 +03:00
6aeafcf2aa https://github.com/iluwatar/java-design-patterns/issues/1016 - decrease number of checkstyle errors in adapter pattern (#1033) 2019-10-26 08:34:30 +03:00
1cb1bdcb57 https://github.com/iluwatar/java-design-patterns/issues/1009 - remove child poms overhead information (#1030)
* https://github.com/iluwatar/java-design-patterns/issues/1009 - remove child versions

* https://github.com/iluwatar/java-design-patterns/issues/1009 - add custom jaxb version for cqrs
2019-10-25 06:58:33 +03:00
1b6cecda19 Update keywords 2019-10-24 23:30:08 +03:00
9403d53096 add license 2019-10-24 20:59:21 +01:00
630532cdda add pattern 2019-10-24 20:56:09 +01:00
acaa6cdc62 local variable type inference changes (#1028)
* local variable type inference changes

replacing type with var

* the type changed back to String

since it is initializing to null and later having different value, it is throwing error in Travis-CI.  Made changes.
2019-10-23 17:25:45 +03:00
4904d7eea0 #1021: Fix checkstyle warnings by changing the license header template (#1027)
* Add custom license header style in order to comply with Google's Checkstyle format

* Update license headers to comply with Google's Checkstyle format
2019-10-22 08:15:35 +03:00
c81c3ff1c7 Use local variable type inference (#995)
* "visitor" pattern: Use local variable type inference

Update "visitor" pattern with local variable type inference.

* "value-object" pattern: Use local variable type inference

Update "value-object" pattern with local variable type inference.

* "unit-of-work" pattern: Use local variable type inference

Update "value-object" pattern with local variable type inference.

* "typeobjectpattern" pattern: Use local variable type inference

Update "value-object" pattern with local variable type inference.
2019-10-21 08:09:29 +03:00
5fc03ee9f8 improve grammar of README (#945)
* improve grammar of README

* Update README.md
2019-10-20 23:21:48 +03:00
20b4195fb2 add first impl 2019-10-20 20:22:54 +01:00
f00ebe1a8d #984 local variable inference changes (#1025)
* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices

* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices
2019-10-20 19:01:02 +03:00
2217fbc5ff Issue#550: double buffer pattern (#1024)
* Basic implementation

* implement double buffer

* add unit test

* add unit test

* Add Readme

* Change local value declaration to var

* Remove unused fields
2019-10-20 18:55:36 +03:00
82f9a6c232 1010: Fixed the two remaining SonarCloud errors (#1023)
The two remaining files were still creating a Random everytime the method
was called. These were missed in the previous commit because the previous
commit had fixed only one of the methods; in other words, there were
multiple methods that were creating the Random object on each call.
2019-10-20 09:02:36 +03:00
f671f03d13 Update FAQ metadata 2019-10-19 22:14:01 +03:00
f09a7eb468 add to init 2019-10-19 18:15:20 +01:00
7c5d5f6b0d 1010: Fixed all of the blocking and critical Sonarcloud errors (#1020)
* 1011: Added SuppressWarnings for SonarCloud errors

All of these files are causing SonarCloud to report the following error:

Loops should not be infinite

Since these instances all require an infinite loop that will never end,
these warnings should be disabled so that SonarCloud no longer reports
them as error.

The rule is: squid:S2189

* 1011: Made all of the randoms static and final

According to SonarCloud rule: "Random" objects should be reused, randoms
should not be recreated. This commit has taken all of the Randoms and made
them constant variables in the files that are using them.
2019-10-19 20:04:44 +03:00
8a4844792f Remove obsolete file 2019-10-19 19:44:57 +03:00
0c60a95d8f Switched to embedded Google checkstyle rules (#1018)
* Switched to embedded Google checkstyle rules

Moved the configuration out of the execution to make it used in all
executions. Fixes #1016

* #1016: Moved checkstyle configuration back into execution

This refactoring may be better done in a new issue as it may have too
many implication.

* Replaced consoleOutput and failsOnError by failOnViolation

consoleOutput outputs everything while failsOnError just fails the build
but doesn't log the error. failOnViolation fails on a violation and logs
it (logViolationsToConsole defaults to true).
2019-10-19 18:41:12 +03:00
c3656109a7 add to init 2019-10-19 16:23:39 +01:00
a204383f45 init repo for role object 2019-10-19 16:17:59 +01:00
2982db456d Update README.md 2019-10-18 23:09:27 +03:00
c308ca09e5 1011: Fixed all of the SonarCloud blocking errors (#1017)
* 1011: Added the method to the RequestMapping annotation

* 1011: Changed all of the a href blank targets to include rel="noopener noreferrer"
2019-10-18 08:50:02 +03:00
880b234d8f Fixes #1007 by updating JUnit to 5.5.2 (#1015)
The missing class PreconditionViolationException is contained in
junit-platform-commons which comes in transitively by this JUnit
version. junit-jupiter-api had to be added because
spring-boot-dependencies imports an older version of this dependency.
2019-10-17 21:00:32 +03:00
a5646b63c1 #554: Subclass Sandbox pattern (#998)
* Fix issue #761: ThreadSafeDoubleCheckLocking.java: Instantiating by Reflection call will be successful if you do that firstly

* Create leader election module

* Create Interface of Instance and MessageManager

* Create implementations with token ring algorithm

* Change package structure.
Create basic message system.

* Implement heartbeat and heartbeat invoking message system

* Implement election message handler

* Add leader message handler

* Add main entry point

* Add comments

* Update README.md

* Fix checkstyle issue

* Add Unit Tests

* Add Unit Tests

* Add bully leader selection

* Change System.out to log print.
Add MIT license in each file.

* Add More java doc comments

* Add unit test

* Add unit tests

* Add subclass-sandbox

* Add Unit Test

* Add Unit Test

* Fix Typo

* Move dependency into parent pom.xml

* Change local valuable reference to be var
2019-10-16 18:21:06 +03:00
27c131c2cb #1001 fix intermittent test failure (#1008) 2019-10-15 19:37:35 +03:00
c438ec0557 Intermittent test failure in Spatial Partition pattern #1001 (#1006)
* Intermittent test failure in Spatial Partition pattern #1001

* Intermittent test failure in Spatial Partition pattern #1001
2019-10-15 19:33:36 +03:00
dd5997b495 993: Fixed the pipeines project layout so that it will load in Eclipse (#1004)
The source directory was not working in the 2019.09 version of Eclipse. The
problem was in the layout of the project: after the src/main/java and
src/test/java, the directory was naed com.iluwatar.pipeline. It should've
been com/iluwatar/pipeline. This follows the hierarchy of all of the other
patterns.

Once these files were moved, the Pipeline project compiled without errors.
2019-10-15 19:21:07 +03:00
e6c71b63fc 988: Replaced all of the Apache HttpClients with Java's java.net.http (#1003)
* 988: Took out the apache http component from root pom.xml

* 988: Updated the aggregator sub projects to use java.net.http instead of apache

* 988: Updated the api-gateway-service sub projects to use java.net.http instead of apache

* Applied the code style formatter
2019-10-15 19:14:08 +03:00
7e698a90dd Fix for issue #413: Circuit Breaker Pattern (#986)
* Fix Issue #413: Circuit-Breaker Pattern

* Fix Image Links

* Remove Javadoc plugin to ensure correct build

* Implementing code review feedback

* Sync README with actual code
2019-10-14 21:32:19 +03:00
088bb764f3 #996 disable sonar analysis for pull requests (#999) 2019-10-14 20:25:35 +03:00
47d92bbffb #996 set sonar host url 2019-10-14 08:17:52 +03:00
cfdfedbd2e #970 single logging framework should be enforced (#982)
* #496 Add pipeline module to parent pom 

* #496: Add main application class and test for pipeline

* #496: Checkstyle format and add log messages on pipeline stages 🎨

* #496: Fill readme sections of pipeline 

* #496: Javadocs and checkstyle formatting 🎨

* #496: Follow PMD checks and add more explanation as block comment on App.java

* #496: Apply requested PR changes by iluwatar 🎨

* #970: Replace log4j usage on commander pattern to Slf4j API 🎨

* #970: Replace log4j usage on dao pattern to Slf4j API 🎨

* #970: Replace log4j usage on data mapper pattern to Slf4j API 🎨

* #970: Remove log4j dependency on data transfer object pom 🔥

* #970: Replace log4j usage on module pattern to Slf4j API 🎨

* #970: Replace log4j usage on serverless pattern to Slf4j API 🎨

This also removes the aws log4j dependency

* #970: Remove unnecessary gitignore line for log4j.xml 🔥

* #970: Remove remaining remnants of log4j 🔥

* #970: Replace System.out logging with appropriate logging methods 🎨

* #970: Replace System.out method references to Logger::info 🎨
2019-10-13 23:41:11 +03:00
72b174619f #996 Fix SonarCloud analysis failure (#997)
* #996 Update Travis config

* #996 Remove old secret

* #996 add coverage profile

* #996 move jacoco out of profile
2019-10-13 23:15:02 +03:00
9ebbc421dd Update license headers 2019-10-12 20:05:54 +03:00
fcc1c0a27c [mvn] - Remove maven-pmd-plugin from the project (#977) (#979) 2019-10-12 12:58:48 +03:00
6faec9901a Bump java language to 11 (#980)
* Moved java XML and annotations dependencies to project level instead
of as profiles
* Set compiler language level to 11
* Removed jdk8 from travis build

* Kept java level 8 in naked-objects/dom for datanucleus enhancer, for
now.
2019-10-12 08:39:58 +03:00
e36bbbb22b Maven profiles to support jdk 11 builds. #948 (#975)
* Maven profiles to support jdk 11 builds. #948

Added maven profiles activated by jdk 11, wich will not break java 8 support.
Bumped lombok and datanucleus enhancer as the old versions dont work with 11.

* Fixed PMD issue when building naked-objects

* Fixed the eip modules with xml dependencies.

Previous dependency relaxing commit causes xml libs to go missing from
some modules that actually needed them
2019-10-11 21:55:48 +03:00
71f26c3e59 Fix Travis xvfb 2019-10-11 19:37:28 +03:00
795b6be17d Configure Travis to build on JDK8 and JDK11 2019-10-11 19:28:50 +03:00
90ea4506ca Leader Election Pattern (#923)
* Fix issue #761: ThreadSafeDoubleCheckLocking.java: Instantiating by Reflection call will be successful if you do that firstly

* Create leader election module

* Create Interface of Instance and MessageManager

* Create implementations with token ring algorithm

* Change package structure.
Create basic message system.

* Implement heartbeat and heartbeat invoking message system

* Implement election message handler

* Add leader message handler

* Add main entry point

* Add comments

* Update README.md

* Fix checkstyle issue

* Add Unit Tests

* Add Unit Tests

* Add bully leader selection

* Change System.out to log print.
Add MIT license in each file.

* Add More java doc comments

* Add unit test

* Add unit tests
2019-10-08 18:29:59 +03:00
41b8d80479 Close #969 (#972) 2019-10-08 18:08:56 +03:00
f903d7e9a9 #496 Pipeline pattern (#967)
* #496 Add pipeline module to parent pom 

* #496: Add main application class and test for pipeline

* #496: Checkstyle format and add log messages on pipeline stages 🎨

* #496: Fill readme sections of pipeline 

* #496: Javadocs and checkstyle formatting 🎨

* #496: Follow PMD checks and add more explanation as block comment on App.java

* #496: Apply requested PR changes by iluwatar 🎨
2019-10-08 09:19:28 +03:00
84c4b034a9 Fix: Github reports security vulnerabilities #933 (#960)
* Fix: Github reports security vulnerabilities  #933

Upgrade camel and spring-data

* -Fix github security vulnerabilities in spring-data and camel

* -Code changes for review comments
2019-10-08 07:42:54 +03:00
f5455f9887 update buggy dependencies (#968) 2019-10-07 19:10:26 +03:00
2b1c09aa72 Fix link in Acyclic Visitor 2019-10-07 09:45:06 +03:00
94ca254626 Fix for issue #954 : Add external Dependencies to run with Java11 (#957)
* Fix for issue #954
Add javax.annotation and java.xml.bind as external maven dependencies
Verified with jdk-11

* Move dependency versions to main pom.xml's dependencyManagement section
2019-10-06 19:06:39 +03:00
60171e3c87 Fix for Issue #549 : Update Exception Handling Code in Aggregator Microservice (#958)
*  Fix for Issue##549

Catch ClientProtocolException and Update Error Logs

* Fix indentation, checkstyle errors
2019-10-06 18:27:39 +03:00
933de30d42 Add JXR plugin to get rid of WARNING Unable to locate Source XRef to link to (#952) 2019-10-05 18:01:23 +03:00
364c43a73a Get rid of build warnings WARNING about problems found when building the effective model (#953) 2019-10-05 17:13:08 +03:00
218ba44dbf Upgrade of maven plugins (#951)
* Upgrade maven plugins

* Upgrade maven plugins

Some general code cleanup was necessary due to upgrade of PMD and checkstyle.

Also needed to add Junit 4 as a dependency due to Mockito.timout issue found here:
https://github.com/mockito/mockito/issues/152
2019-10-05 14:23:20 +03:00
05d0f0babf #834 Fix dependency management issue for POM files (#940) 2019-10-03 21:50:50 +03:00
823c58bef2 added new information (#937) 2019-10-02 10:53:57 +03:00
b03e0b8c35 Fix for BallThreadTest#testResume (#935)
* Fix for flaky test

* Remove other file changes

* Remove other file changes

* Remove other file changes not related to bug
2019-10-01 21:34:19 +03:00
3d62e02891 fixed bug #929: close async service before the main thread finishes (#931) 2019-09-30 18:32:29 +03:00
06fa92af2c Removing the dead link to resove automagic issue as mentioned in issue#915 (#927) 2019-09-30 18:27:02 +03:00
6b297b701f Data Locality pattern #559 (#889)
* Data Locality pattern #559

* Fixed review comments

* updated pom

* Fixed failed build
2019-09-30 18:19:08 +03:00
5f39f7fbf7 Updating README.md file to update doc as suggested in issue#925 (#926) 2019-09-20 08:08:43 +03:00
019abc9980 Add license headers 2019-09-10 20:26:18 +03:00
b874adc296 Set version for next development iteration 2019-09-08 11:01:12 +03:00
9bf7a059b8 Java Design Patterns v1.21.0 2019-09-08 10:49:40 +03:00
88fae070e6 Fix broken links #915 (#921) 2019-09-07 21:18:13 +03:00
f1410337b5 Fix issue #761: ThreadSafeDoubleCheckLocking.java: Instantiating by Reflection call will be successful if you do that firstly (#920) 2019-09-07 21:13:15 +03:00
8c865e6b4d clean code (#910) 2019-09-07 21:07:01 +03:00
c653edf38f fix must override a superclass method (#919)
* fix must override a superclass method

* fix must override a superclass method
2019-09-07 20:52:49 +03:00
35dc25d480 MInor bug fix Issue #895 -> Code comment change (https://github.com/iluwatar/java-design-patterns/issues/895) (#901) 2019-09-07 20:24:40 +03:00
318f811fea Bytecode pattern #553 (#896)
* Added bytecode pattern

* Diagram changed and added licence information

* Added bytecode module to main pom.

* Fixed missing dependency error
2019-09-03 21:50:48 +03:00
7f6067f19f Added priority queue design pattern (#888)
* added priority queue design pattern

* Minor Refactored, fixed review comments
2019-08-31 21:10:35 +03:00
11c0550559 Create .sonarcloud.properties 2019-08-21 21:51:27 +03:00
085e47b50d Update SonarCloud badge 2019-08-21 21:47:36 +03:00
61ef59de02 fix code example containing syntax error (#890) 2019-08-11 21:06:27 +03:00
ccb257d525 fixed bug #883 (#885) 2019-08-04 17:11:56 +03:00
6daaeec5c6 Remove the transitive dependency(junit-jupiter-api) (#916) 2019-07-30 22:46:38 +03:00
517c20960d Added one more Credit/Article about the benefits of Repository pattern (#882) 2019-07-29 21:31:42 +03:00
36e80c4e69 fixed failing tests (#860) (#880) 2019-07-29 21:27:08 +03:00
3454941dcd Typo coresponding -> corresponding (#879) 2019-07-29 21:22:56 +03:00
b497d41f61 Modify Observer pattern UML (#877) 2019-07-29 21:21:07 +03:00
aaabc8f517 Fix the dependency conflict issue (#872) 2019-07-29 21:16:21 +03:00
2757b210ea Best practice when compare enum (#869) 2019-07-29 21:12:14 +03:00
d9a567cf97 Commander pattern #505 (#857)
* Commander pattern

* Fix checkstyle errors

* Update Commander.java

* Update README.md

* Update PaymentService.java

* Update Commander.java

* Update README.md
2019-07-29 21:09:08 +03:00
a113de6a14 Add licenses 2019-07-28 16:24:14 +03:00
f7e22a1cf6 508 : Sonar qube critical Issue Fix (#854)
* 508 : Sonar qube critical Issue Fix
Refactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed.

* 508: Sonar Qube Issue fxes
Define a constant instead of duplicating this literal " does not exist." 3 times.

* 508: sonar qube issue fixes
Define a constant instead of duplicating this literal "Some external api for only realtime execution could be called here." 3 times.
2019-07-28 15:42:03 +03:00
c6ecf58687 508 : sonar qube critical issue fixes (#852)
* 508 : sonar qube critical issue fixes

* 508 : Sunar Qube Fixes
Define a constant instead of duplicating this literal "user_accounts" 4 times.
Define a constant instead of duplicating this literal "userID" 5 times
Define a constant instead of duplicating this literal "additionalInfo" 4 times.
Define a constant instead of duplicating this literal "userName" 4 times.

* 508 : Sunar Qube Fixes
Define a constant instead of duplicating this literal "user_accounts" 4 times.

* 508 : Sonar Qube Fixes
Define a constant instead of duplicating this literal "eEvans" 4 times
Define a constant instead of duplicating this literal "jBloch" 6 times
Define a constant instead of duplicating this literal "mFowler" 3 times

* 508 : Sonar Qube FIxes
Define a constant instead of duplicating this literal "username" 3 times.

* 508: sonar qube issue fixes
Define a constant instead of duplicating this literal "customerDao.getAllCustomers(): " 4 times.

* 508 : sonar qube issue fixes
Define a constant instead of duplicating this literal "App.main(), student : " 4 times.

* 508 : sonar Qube issue fixes
Define a constant instead of duplicating this literal "{} hits {}. {} is damaged!" 3 times.
Define a constant instead of duplicating this literal "{} hits {}." 4 times.

* 508 : Define a constant instead of duplicating this literal "{} hits {}." 4 times.

* 508 : checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: cqrs checkstyle fixes
2019-07-28 15:39:40 +03:00
17bfc91f45 Change Travis CI build env. to Trusty (#911) 2019-07-28 14:20:18 +03:00
0c6237c225 Type object pattern #555 (#848)
* typeobject pattern

* fixing errors

* fix error cellpool

* Update README.md

* Update README.md
2019-07-24 22:08:30 +03:00
fedc2d9e47 Minor ReadMe Update (#864)
Two sentences read a little awkward, so I tweaked them. Hope this helps!
2019-04-07 08:41:35 +03:00
b6b4602baf 845 : unnecassary return deleted (#856) 2019-02-16 22:53:06 +02:00
eafe52e17a 756 : faq added (#855) 2019-02-15 20:00:21 +02:00
5251ec4a93 removed unnecessary static modifier on enum definition (#853) 2019-02-15 19:55:23 +02:00
26f1a608ab Update license headers 2019-02-13 23:14:53 +02:00
7a25c57474 Master worker pattern #799 (#831)
* master worker pattern

* Update App.java

* Adding new line to README.md

* Adding new line to pom.xml

* Adding new line to ArrayEquality.java

* Adding new line to Input.java

* Adding new line to Result.java

* Adding new line to ArrayTransposeMasterWorker.java

* Adding new line to ArrayTransposeMaster.java

* Adding new line to ArrayTransposeWorker.java

* Adding new line to Worker.java

* Adding new line to ArrayInputTest.java

* Adding new line ArrayTransposeMasterWorkerTest.java

* Adding new line to ArrayResult.java

* Review changes

* Update README.md
2019-02-13 23:04:16 +02:00
55c7579983 Fix script blocking (#843) 2019-02-04 08:35:06 +02:00
10cb191533 Retry exponential backoff #775 (#829)
* Spatial partition

* Retry with exponential backoff

* retry exponential backoff

* branch error
2019-02-04 08:27:13 +02:00
a6749cb63e Spatial partition pattern #562 (#828)
* Spatial partition

* Update pom.xml

* Update Bubble.java - pmd

* Update Rect.java - pmd
2018-12-22 23:37:31 +02:00
7b8c9b07ed Fix typo (#832) 2018-12-17 12:12:54 +05:30
0fa18d91c6 Added real world example of Command pattern
JUnit 4 Statement class is also an example of Command pattern. Added that to list of real world examples
2018-12-03 18:58:20 +05:30
53b673d5b0 No Need declare App class as a utility class (#827) 2018-11-25 19:35:22 +02:00
966c56311c Update Readme.md (#815)
Added a tutorial link for  intercepting filter design pattern
2018-11-04 20:12:04 +02:00
150f72758e Add missing license headers 2018-11-03 09:13:59 +02:00
4446e74338 Hexagonal pattern fixes (#814)
* Fixed wrong else condition

* Simplified creating Set of numbers

* Deleted unused imports

* Replaced 'for' loop with 'foreach' one

* Replaced explicit type with diamond

* Removed unnecesary brackets from lambda

* Removed unnecesary contains check before adding element to Set

* Fixed typo and changed non-english constant names
2018-10-27 16:39:16 +05:30
70f6e54353 Fix blocker issues on Sonar #508 (#810)
* Fix blocker issues on Sonar

* Replace Assertj assertions with JUnit ones
2018-10-25 18:43:58 +05:30
1f1fcae513 Refactor Page-object pattern (#812)
* Refactor : create 2 sub-modules for page-object pattern

* Replace e.printStrackTrace with logger
2018-10-24 23:17:46 +03:00
2aa9e78ddd Minor refactorings and code style changes (#807)
* Made minor changes in some patterns such as removed throws clause where not needed, changed incorrect order of arguments in assertEquals

* Minor refactorings and code style changes. 1) Removed several use of raw types 2) Removed unnecessary throws clauses 3) Used lambda expressions wherever applicable 4) Used apt assertion methods for readability 5) Use of try with resources wherever applicable 6) Corrected incorrect order of assertXXX arguments

* Removed unused import from Promise

* Addressed review comments

* Addressed checkstyle issue
2018-10-23 13:45:41 +05:30
25ed7c09c5 Refactored Event Queue (#806)
* 1) Test cases were not stopping AudioService before ending test case 2) Changed Audio to be a good singleton, previously because of Audio being bad singleton, test cases which were using static methods could have caused intermittent failures. 3) Made some other refactorings as well

* Removed sonar issue and converted Audio to eager singleton for simplicity

* Updated class diagram PNG
2018-10-21 21:15:33 +03:00
922fd62da6 Resolves #643, test cases failed due to global state in CallsCount (#803)
* Resolves #643, test cases failed due to presence of global state in CallsCount. Because AppTest was executed before B2BServiceTest, it scheduled 1 sec timer using ThrottleTimerImpl class. While resetting it used that global CallCount class reset() method, which reset all counters. So that causes thread safety issue because of unintended sharing of application state between test cases, which is not a good practice.

* Updated class diagram png and added UCLS file
2018-10-21 21:14:07 +03:00
9e7a500743 Refactoring changes in Ambassador Pattern (#805)
* 1) Updated test cases to use Junit Assert method as compared to assert keyword 2) Proper testing of RemoteService using RandomProvider interface. Introduced RandomProvider interface so that randomness can be controlled from test cases. 3) For readability used constant for representing FAILURE

* Addressing review comments, Deleting unintentional file and used FAILURE constant in ClientTest as well
2018-10-21 21:12:03 +03:00
21a149ee77 Merge pull request #801 from iluwatar/HexagonalRefactoring
Minor refactorings in Hexagonal architecture
2018-10-21 09:54:28 +03:00
f5eaf06c1c Merge pull request #802 from iluwatar/Issue#699
Resolves #699 Intermittent failure was due to Thread.sleep in the code
2018-10-21 09:25:06 +03:00
3c6fb0c53b Merge pull request #800 from trumvekhuya/master
Fix small points in Strategy and Decorator pattern.
2018-10-21 08:46:24 +03:00
829df031c3 Intermittent failure was due to Thread.sleep in the code. While performing unit test cases there was race condition between two threads, so it was not guaranteed to work every time. Used an interface DelayProvider for simulating delay, and while unit testing fake delay provider is used that eradicates the use of Threads in unit test cases, which is not a good practice. 2018-10-15 16:36:27 +05:30
37ae182630 Resolved PMD issues 2018-10-15 13:30:20 +05:30
ab2c12e734 1) Refactored LotteryNumbers to use Joiner from guava library to join lottery numbers. 2) Solved potential thread safety issue in LotteryTicketId class, where it was using raw primitive value and incrementing it which is not thread-safe. So used AtomicInteger for brevity 3) assertEquals arguments were in incorrect order at many places, so changed order of those 4) Replaced assertFalse and assertTrue at some places with assertEquals and assertNotEquals for reducing complexity of code 5) Removed public modifiers from test cases, as they are no more needed by JUnit 5 2018-10-15 13:21:00 +05:30
b3f0cc7e00 - Assign ClubberTroll to another variable in README 2018-10-15 11:52:56 +07:00
86e9c66ca5 - Assign new clubberTroll instance to another variable.
- Remove redundant Exception from throws list in unit tests.
2018-10-15 11:41:14 +07:00
a6e6c22bf6 Remove redundant Exception from throws list in DragonSlayerTest 2018-10-15 10:44:14 +07:00
1940 changed files with 53991 additions and 17537 deletions

1021
.all-contributorsrc Normal file

File diff suppressed because it is too large Load Diff

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
github: [iluwatar]

60
.github/workflows/maven.yml vendored Normal file
View File

@ -0,0 +1,60 @@
#
# The MIT License
# 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:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# 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
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# 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
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Some tests need screen access
- name: Install xvfb
run: sudo apt-get install xvfb
# SonarQube scan does not work for forked repositories
# See https://jira.sonarsource.com/browse/MMF-1371
- name: Build with Maven
if: github.ref != 'refs/heads/master'
run: xvfb-run mvn clean verify
- name: Build with Maven and run SonarQube analysis
if: github.ref == 'refs/heads/master'
run: xvfb-run mvn clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
# These two env variables are needed for sonar analysis
GITHUB_TOKEN: ${{ secrets.REPOSITORY_ACCESS_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

1
.gitignore vendored
View File

@ -16,5 +16,4 @@ datanucleus.log
/bin/
/bin/
*.log
data-mapper/src/main/resources/log4j.xml
event-sourcing/Journal.json

View File

@ -1,39 +0,0 @@
language: java
jdk:
- oraclejdk8
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
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
webhooks:
urls:
- https://webhooks.gitter.im/e/3319623945358a093a6f
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

View File

@ -1,13 +0,0 @@
# Code Coverage Report generation
To generate the code coverage report, execute the following command:
> mvn clean verify jacoco:report
This will generate code coverage report in each of the modules. In order to view the same, open the following file in your browser.
> target/site/jacoco/index.html
Please note that the above folder is created under each of the modules. For example:
* adapter/target/site/jacoco/index.html
* busniess-delegate/target/site/jacoco/index.html

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014-2016 Ilkka Seppälä
Copyright (c) 2014-2020 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

217
README.md
View File

@ -4,44 +4,239 @@
# 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)
![Java CI with Maven](https://github.com/iluwatar/java-design-patterns/workflows/Java%20CI%20with%20Maven/badge.svg)
[![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://sonarcloud.io/api/project_badges/measure?project=com.iluwatar%3Ajava-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard/index/com.iluwatar%3Ajava-design-patterns)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=iluwatar_java-design-patterns&metric=alert_status)](https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-111-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# Introduction
Design patterns are formalized best practices that the 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
development paradigms.
Reusing design patterns helps to prevent subtle issues that can 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](https://java-design-patterns.com/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
patterns should only be introduced when they are needed for practical
extensibility.
Once you are familiar with these concepts you can start drilling down into
patterns by any of the following approaches
Once you are familiar with these concepts you can start drilling down into the
[available design patterns](https://java-design-patterns.com/patterns/) by any
of the following approaches
- Using difficulty tags, `Difficulty-Beginner`, `Difficulty-Intermediate` & `Difficulty-Expert`.
- 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).
- Search for a specific pattern by name. Can't find one? Please report a new pattern [here](https://github.com/iluwatar/java-design-patterns/issues).
- 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.
# 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
This project is licensed under the terms of the MIT license.
# Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/iluwatar"><img src="https://avatars1.githubusercontent.com/u/582346?v=4" width="100px;" alt=""/><br /><sub><b>Ilkka Seppälä</b></sub></a><br /><a href="#projectManagement-iluwatar" title="Project Management">📆</a> <a href="#maintenance-iluwatar" title="Maintenance">🚧</a> <a href="#content-iluwatar" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/amit1307"><img src="https://avatars0.githubusercontent.com/u/23420222?v=4" width="100px;" alt=""/><br /><sub><b>amit1307</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amit1307" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/npathai"><img src="https://avatars2.githubusercontent.com/u/1792515?v=4" width="100px;" alt=""/><br /><sub><b>Narendra Pathai</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=npathai" title="Code">💻</a> <a href="#ideas-npathai" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3Anpathai" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/fluxw42"><img src="https://avatars1.githubusercontent.com/u/1545460?v=4" width="100px;" alt=""/><br /><sub><b>Jeroen Meulemeester</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=fluxw42" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://www.joemccarthy.co.uk"><img src="https://avatars0.githubusercontent.com/u/4526195?v=4" width="100px;" alt=""/><br /><sub><b>Joseph McCarthy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mikulucky" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/thomasoss"><img src="https://avatars1.githubusercontent.com/u/22516154?v=4" width="100px;" alt=""/><br /><sub><b>Thomas</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=thomasoss" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/anuragagarwal561994"><img src="https://avatars1.githubusercontent.com/u/6075379?v=4" width="100px;" alt=""/><br /><sub><b>Anurag Agarwal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=anuragagarwal561994" title="Code">💻</a></td>
<td align="center"><a href="https://markusmo3.github.io"><img src="https://avatars1.githubusercontent.com/u/3317416?v=4" width="100px;" alt=""/><br /><sub><b>Markus Moser</b></sub></a><br /><a href="#design-markusmo3" title="Design">🎨</a> <a href="https://github.com/iluwatar/java-design-patterns/commits?author=markusmo3" title="Code">💻</a> <a href="#ideas-markusmo3" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
<tr>
<td align="center"><a href="https://twitter.com/i_sabiq"><img src="https://avatars1.githubusercontent.com/u/19510920?v=4" width="100px;" alt=""/><br /><sub><b>Sabiq Ihab</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=isabiq" title="Code">💻</a></td>
<td align="center"><a href="http://inbravo.github.io"><img src="https://avatars3.githubusercontent.com/u/5253764?v=4" width="100px;" alt=""/><br /><sub><b>Amit Dixit</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=inbravo" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/piyushchaudhari04"><img src="https://avatars3.githubusercontent.com/u/10268029?v=4" width="100px;" alt=""/><br /><sub><b>Piyush Kailash Chaudhari</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=piyushchaudhari04" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/joshzambales"><img src="https://avatars1.githubusercontent.com/u/8704552?v=4" width="100px;" alt=""/><br /><sub><b>joshzambales</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=joshzambales" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Crossy147"><img src="https://avatars2.githubusercontent.com/u/7272996?v=4" width="100px;" alt=""/><br /><sub><b>Kamil Pietruszka</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Crossy147" title="Code">💻</a></td>
<td align="center"><a href="http://cs.joensuu.fi/~zkhayda"><img src="https://avatars2.githubusercontent.com/u/660742?v=4" width="100px;" alt=""/><br /><sub><b>Zafar Khaydarov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=zafarella" title="Code">💻</a> <a href="https://github.com/iluwatar/java-design-patterns/commits?author=zafarella" title="Documentation">📖</a></td>
<td align="center"><a href="https://kemitix.github.io/"><img src="https://avatars1.githubusercontent.com/u/1147749?v=4" width="100px;" alt=""/><br /><sub><b>Paul Campbell</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kemitix" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Argyro-Sioziou"><img src="https://avatars0.githubusercontent.com/u/22822639?v=4" width="100px;" alt=""/><br /><sub><b>Argyro Sioziou</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Argyro-Sioziou" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/TylerMcConville"><img src="https://avatars0.githubusercontent.com/u/4946449?v=4" width="100px;" alt=""/><br /><sub><b>TylerMcConville</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=TylerMcConville" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/saksham93"><img src="https://avatars1.githubusercontent.com/u/37399540?v=4" width="100px;" alt=""/><br /><sub><b>saksham93</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=saksham93" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/nikhilbarar"><img src="https://avatars2.githubusercontent.com/u/37332144?v=4" width="100px;" alt=""/><br /><sub><b>nikhilbarar</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=nikhilbarar" title="Code">💻</a></td>
<td align="center"><a href="http://colinbut.com"><img src="https://avatars2.githubusercontent.com/u/10725674?v=4" width="100px;" alt=""/><br /><sub><b>Colin But</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=colinbut" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ruslanpa"><img src="https://avatars2.githubusercontent.com/u/1503411?v=4" width="100px;" alt=""/><br /><sub><b>Ruslan</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ruslanpa" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/JuhoKang"><img src="https://avatars1.githubusercontent.com/u/4745294?v=4" width="100px;" alt=""/><br /><sub><b>Juho Kang</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=JuhoKang" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dheeraj-mummareddy"><img src="https://avatars2.githubusercontent.com/u/7002230?v=4" width="100px;" alt=""/><br /><sub><b>Dheeraj Mummareddy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dheeraj-mummareddy" title="Code">💻</a></td>
<td align="center"><a href="https://www.bernardosulzbach.com"><img src="https://avatars0.githubusercontent.com/u/8271090?v=4" width="100px;" alt=""/><br /><sub><b>Bernardo Sulzbach</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=bernardosulzbach" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/4lexis"><img src="https://avatars0.githubusercontent.com/u/19871727?v=4" width="100px;" alt=""/><br /><sub><b>Aleksandar Dudukovic</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=4lexis" title="Code">💻</a></td>
<td align="center"><a href="https://www.yusufaytas.com"><img src="https://avatars2.githubusercontent.com/u/1049483?v=4" width="100px;" alt=""/><br /><sub><b>Yusuf Aytaş</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=yusufaytas" title="Code">💻</a></td>
<td align="center"><a href="http://futurehomes.hu"><img src="https://avatars2.githubusercontent.com/u/1001491?v=4" width="100px;" alt=""/><br /><sub><b>Mihály Kuprivecz</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=qpi" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/kapinuss"><img src="https://avatars0.githubusercontent.com/u/17639945?v=4" width="100px;" alt=""/><br /><sub><b>Stanislav Kapinus</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kapinuss" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/gvsharma"><img src="https://avatars1.githubusercontent.com/u/6648152?v=4" width="100px;" alt=""/><br /><sub><b>GVSharma</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gvsharma" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/SrdjanPaunovic"><img src="https://avatars1.githubusercontent.com/u/22815104?v=4" width="100px;" alt=""/><br /><sub><b>Srđan Paunović</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=SrdjanPaunovic" title="Code">💻</a></td>
<td align="center"><a href="https://sideris.xyz/"><img src="https://avatars3.githubusercontent.com/u/5484694?v=4" width="100px;" alt=""/><br /><sub><b>Petros G. Sideris</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=sideris" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/pramodgupta3/"><img src="https://avatars1.githubusercontent.com/u/2184241?v=4" width="100px;" alt=""/><br /><sub><b>Pramod Gupta</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/pulls?q=is%3Apr+reviewed-by%3AIAmPramod" title="Reviewed Pull Requests">👀</a></td>
</tr>
<tr>
<td align="center"><a href="https://amarnath510.github.io/portfolio"><img src="https://avatars0.githubusercontent.com/u/4599623?v=4" width="100px;" alt=""/><br /><sub><b>Amarnath Chandana</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Amarnath510" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Anurag870"><img src="https://avatars1.githubusercontent.com/u/6295975?v=4" width="100px;" alt=""/><br /><sub><b>Anurag870</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Anurag870" title="Code">💻</a></td>
<td align="center"><a href="http://theerroris.me"><img src="https://avatars0.githubusercontent.com/u/1685953?v=4" width="100px;" alt=""/><br /><sub><b>Wes Gilleland</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Deathnerd" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Harshrajsinh"><img src="https://avatars2.githubusercontent.com/u/22811531?v=4" width="100px;" alt=""/><br /><sub><b>Harshraj Thakor</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Harshrajsinh" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/MaVdbussche"><img src="https://avatars1.githubusercontent.com/u/26136934?v=4" width="100px;" alt=""/><br /><sub><b>Martin Vandenbussche</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=MaVdbussche" title="Code">💻</a></td>
<td align="center"><a href="https://alexsomai.com"><img src="https://avatars1.githubusercontent.com/u/5720977?v=4" width="100px;" alt=""/><br /><sub><b>Alexandru Somai</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=alexsomai" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/amogozov"><img src="https://avatars3.githubusercontent.com/u/7372215?v=4" width="100px;" alt=""/><br /><sub><b>Artur Mogozov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amogozov" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/anthonycampbell"><img src="https://avatars3.githubusercontent.com/u/10249255?v=4" width="100px;" alt=""/><br /><sub><b>anthony</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=anthonycampbell" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://ccygnus.com/"><img src="https://avatars1.githubusercontent.com/u/9342724?v=4" width="100px;" alt=""/><br /><sub><b>Christian Cygnus</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=christophercolumbusdog" title="Code">💻</a></td>
<td align="center"><a href="https://about.me/dzmitryh"><img src="https://avatars2.githubusercontent.com/u/5390492?v=4" width="100px;" alt=""/><br /><sub><b>Dima Gubin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dzmitryh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/jjjimenez100"><img src="https://avatars3.githubusercontent.com/u/22243493?v=4" width="100px;" alt=""/><br /><sub><b>Joshua Jimenez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=jjjimenez100" title="Code">💻</a></td>
<td align="center"><a href="http://about.me/kaiwinter"><img src="https://avatars0.githubusercontent.com/u/110982?v=4" width="100px;" alt=""/><br /><sub><b>Kai Winter</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kaiwinter" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/lbroman"><img src="https://avatars1.githubusercontent.com/u/86007?v=4" width="100px;" alt=""/><br /><sub><b>lbroman</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=lbroman" title="Code">💻</a></td>
<td align="center"><a href="https://przemeknowak.com"><img src="https://avatars1.githubusercontent.com/u/3254609?v=4" width="100px;" alt=""/><br /><sub><b>Przemek</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=pnowy" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/prafful1"><img src="https://avatars0.githubusercontent.com/u/14350274?v=4" width="100px;" alt=""/><br /><sub><b>Prafful Agarwal</b></sub></a><br /><a href="#content-prafful1" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/sankypanhale"><img src="https://avatars1.githubusercontent.com/u/6478783?v=4" width="100px;" alt=""/><br /><sub><b>Sanket Panhale</b></sub></a><br /><a href="#content-sankypanhale" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/staillebois"><img src="https://avatars0.githubusercontent.com/u/23701200?v=4" width="100px;" alt=""/><br /><sub><b>staillebois</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=staillebois" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/valdar-hu"><img src="https://avatars3.githubusercontent.com/u/17962817?v=4" width="100px;" alt=""/><br /><sub><b>Krisztián Nagy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=valdar-hu" title="Code">💻</a></td>
<td align="center"><a href="https://www.vanogrid.com"><img src="https://avatars0.githubusercontent.com/u/4307918?v=4" width="100px;" alt=""/><br /><sub><b>Alexander Ivanov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vanogrid" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/yosfik"><img src="https://avatars3.githubusercontent.com/u/4850270?v=4" width="100px;" alt=""/><br /><sub><b>Yosfik Alqadri</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=yosfik" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/7agustibm"><img src="https://avatars0.githubusercontent.com/u/8149332?v=4" width="100px;" alt=""/><br /><sub><b>Agustí Becerra Milà</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=7agustibm" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Juaanma"><img src="https://avatars3.githubusercontent.com/u/7390500?v=4" width="100px;" alt=""/><br /><sub><b>Juan Manuel Suárez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Juaanma" title="Code">💻</a></td>
<td align="center"><a href="http://www.devsedge.net/"><img src="https://avatars0.githubusercontent.com/u/9956006?v=4" width="100px;" alt=""/><br /><sub><b>Luigi Cortese</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=LuigiCortese" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Rzeposlaw"><img src="https://avatars2.githubusercontent.com/u/18425745?v=4" width="100px;" alt=""/><br /><sub><b>Katarzyna Rzepecka</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Rzeposlaw" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://adamski.pro"><img src="https://avatars1.githubusercontent.com/u/6537430?v=4" width="100px;" alt=""/><br /><sub><b>adamski.pro</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=akrystian" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/baislsl"><img src="https://avatars0.githubusercontent.com/u/17060584?v=4" width="100px;" alt=""/><br /><sub><b>Shengli Bai</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=baislsl" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/besok"><img src="https://avatars2.githubusercontent.com/u/29834592?v=4" width="100px;" alt=""/><br /><sub><b>Boris</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=besok" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dmitraver"><img src="https://avatars3.githubusercontent.com/u/1798156?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Avershin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dmitraver" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/fanofxiaofeng"><img src="https://avatars0.githubusercontent.com/u/3983683?v=4" width="100px;" alt=""/><br /><sub><b>靳阳</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=fanofxiaofeng" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hoangnam2261"><img src="https://avatars2.githubusercontent.com/u/31692990?v=4" width="100px;" alt=""/><br /><sub><b>hoangnam2261</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hoangnam2261" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/jarpit96"><img src="https://avatars2.githubusercontent.com/u/10098713?v=4" width="100px;" alt=""/><br /><sub><b>Arpit Jain</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=jarpit96" title="Code">💻</a></td>
<td align="center"><a href="http://joningi.net"><img src="https://avatars2.githubusercontent.com/u/6115148?v=4" width="100px;" alt=""/><br /><sub><b>Jón Ingi Sveinbjörnsson</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=joningiwork" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/kirill-vlasov"><img src="https://avatars3.githubusercontent.com/u/16112495?v=4" width="100px;" alt=""/><br /><sub><b>Kirill Vlasov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kirill-vlasov" title="Code">💻</a></td>
<td align="center"><a href="http://mitchell-irvin.com"><img src="https://avatars0.githubusercontent.com/u/16233245?v=4" width="100px;" alt=""/><br /><sub><b>Mitchell Irvin</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mitchellirvin" title="Code">💻</a></td>
<td align="center"><a href="https://ranjeet-floyd.github.io"><img src="https://avatars0.githubusercontent.com/u/1992972?v=4" width="100px;" alt=""/><br /><sub><b>Ranjeet</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ranjeet-floyd" title="Code">💻</a></td>
<td align="center"><a href="https://alwayswithme.github.io"><img src="https://avatars3.githubusercontent.com/u/3234786?v=4" width="100px;" alt=""/><br /><sub><b>PhoenixYip</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Alwayswithme" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/MSaifAsif"><img src="https://avatars1.githubusercontent.com/u/6280554?v=4" width="100px;" alt=""/><br /><sub><b>M Saif Asif</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=MSaifAsif" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/kanwarpreet25"><img src="https://avatars0.githubusercontent.com/u/39183641?v=4" width="100px;" alt=""/><br /><sub><b>kanwarpreet25</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=kanwarpreet25" title="Code">💻</a></td>
<td align="center"><a href="http://leonmak.me"><img src="https://avatars3.githubusercontent.com/u/13071508?v=4" width="100px;" alt=""/><br /><sub><b>Leon Mak</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=leonmak" title="Code">💻</a></td>
<td align="center"><a href="http://www.wramdemark.se"><img src="https://avatars2.githubusercontent.com/u/7052193?v=4" width="100px;" alt=""/><br /><sub><b>Per Wramdemark</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=perwramdemark" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/waisuan"><img src="https://avatars2.githubusercontent.com/u/10975700?v=4" width="100px;" alt=""/><br /><sub><b>Evan Sia Wai Suan</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=waisuan" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/AnaghaSasikumar"><img src="https://avatars2.githubusercontent.com/u/42939261?v=4" width="100px;" alt=""/><br /><sub><b>AnaghaSasikumar</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=AnaghaSasikumar" title="Code">💻</a></td>
<td align="center"><a href="https://christofferh.com"><img src="https://avatars1.githubusercontent.com/u/767643?v=4" width="100px;" alt=""/><br /><sub><b>Christoffer Hamberg</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=christofferh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/dgruntz"><img src="https://avatars0.githubusercontent.com/u/1516800?v=4" width="100px;" alt=""/><br /><sub><b>Dominik Gruntz</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=dgruntz" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://bitbucket.org/hannespernpeintner/"><img src="https://avatars3.githubusercontent.com/u/1679437?v=4" width="100px;" alt=""/><br /><sub><b>Hannes</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hannespernpeintner" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/leogtzr"><img src="https://avatars0.githubusercontent.com/u/1211969?v=4" width="100px;" alt=""/><br /><sub><b>Leo Gutiérrez Ramírez</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=leogtzr" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/npczwh"><img src="https://avatars0.githubusercontent.com/u/14066422?v=4" width="100px;" alt=""/><br /><sub><b>Zhang WH</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=npczwh" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/oconnelc"><img src="https://avatars0.githubusercontent.com/u/1112973?v=4" width="100px;" alt=""/><br /><sub><b>Christopher O'Connell</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=oconnelc" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/giorgosmav21"><img src="https://avatars2.githubusercontent.com/u/22855493?v=4" width="100px;" alt=""/><br /><sub><b>George Mavroeidis</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=giorgosmav21" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hbothra15"><img src="https://avatars1.githubusercontent.com/u/7418012?v=4" width="100px;" alt=""/><br /><sub><b>Hemant Bothra</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hbothra15" title="Code">💻</a></td>
<td align="center"><a href="https://www.kevinpeters.net/about/"><img src="https://avatars1.githubusercontent.com/u/12736734?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Peters</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=igeligel" title="Code">💻</a></td>
<td align="center"><a href="https://llorllale.github.io/"><img src="https://avatars1.githubusercontent.com/u/2019896?v=4" width="100px;" alt=""/><br /><sub><b>George Aristy</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=llorllale" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/mookkiah"><img src="https://avatars1.githubusercontent.com/u/8975264?v=4" width="100px;" alt=""/><br /><sub><b>Mahendran Mookkiah</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=mookkiah" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Azureyjt"><img src="https://avatars2.githubusercontent.com/u/18476317?v=4" width="100px;" alt=""/><br /><sub><b>Azureyjt</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=Azureyjt" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vehpsr"><img src="https://avatars2.githubusercontent.com/u/3133265?v=4" width="100px;" alt=""/><br /><sub><b>gans</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vehpsr" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ThatGuyWithTheHat"><img src="https://avatars0.githubusercontent.com/u/24470582?v=4" width="100px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /><a href="#content-ThatGuyWithTheHat" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://www.linkedin.com/in/gopinathlangote/"><img src="https://avatars2.githubusercontent.com/u/10210778?v=4" width="100px;" alt=""/><br /><sub><b>Gopinath Langote</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=gopinath-langote" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/hoswey"><img src="https://avatars3.githubusercontent.com/u/3689445?v=4" width="100px;" alt=""/><br /><sub><b>Hoswey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=hoswey" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/amit2103"><img src="https://avatars3.githubusercontent.com/u/7566692?v=4" width="100px;" alt=""/><br /><sub><b>Amit Pandey</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=amit2103" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/gwildor28"><img src="https://avatars0.githubusercontent.com/u/16000365?v=4" width="100px;" alt=""/><br /><sub><b>gwildor28</b></sub></a><br /><a href="#content-gwildor28" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://t.me/paul_docker"><img src="https://avatars1.githubusercontent.com/u/2404785?v=4" width="100px;" alt=""/><br /><sub><b>田浩</b></sub></a><br /><a href="#content-llitfkitfk" title="Content">🖋</a></td>
<td align="center"><a href="https://twitter.com/StPitsios"><img src="https://avatars1.githubusercontent.com/u/6773603?v=4" width="100px;" alt=""/><br /><sub><b>Stamatis Pitsios</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=pitsios-s" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/qza"><img src="https://avatars3.githubusercontent.com/u/233149?v=4" width="100px;" alt=""/><br /><sub><b>qza</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=qza" title="Code">💻</a></td>
<td align="center"><a href="http://tschis.github.io"><img src="https://avatars1.githubusercontent.com/u/20662669?v=4" width="100px;" alt=""/><br /><sub><b>Rodolfo Forte</b></sub></a><br /><a href="#content-Tschis" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/ankurkaushal"><img src="https://avatars2.githubusercontent.com/u/2236616?v=4" width="100px;" alt=""/><br /><sub><b>Ankur Kaushal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=ankurkaushal" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/ovidijus-okinskas/"><img src="https://avatars0.githubusercontent.com/u/20372387?v=4" width="100px;" alt=""/><br /><sub><b>Ovidijus Okinskas</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=okinskas" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/robertt240"><img src="https://avatars1.githubusercontent.com/u/9137432?v=4" width="100px;" alt=""/><br /><sub><b>Robert Kasperczyk</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=robertt240" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/trautonen"><img src="https://avatars3.githubusercontent.com/u/1641063?v=4" width="100px;" alt=""/><br /><sub><b>Tapio Rautonen</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=trautonen" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="http://vk.com/yuri.orlov"><img src="https://avatars0.githubusercontent.com/u/1595733?v=4" width="100px;" alt=""/><br /><sub><b>Yuri Orlov</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=yorlov" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/varunu28/"><img src="https://avatars0.githubusercontent.com/u/7676016?v=4" width="100px;" alt=""/><br /><sub><b>Varun Upadhyay</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=varunu28" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/PalAditya"><img src="https://avatars2.githubusercontent.com/u/25523604?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Pal</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=PalAditya" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/grzesiekkedzior"><img src="https://avatars3.githubusercontent.com/u/23739158?v=4" width="100px;" alt=""/><br /><sub><b>grzesiekkedzior</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=grzesiekkedzior" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/sivasubramanim"><img src="https://avatars2.githubusercontent.com/u/51107434?v=4" width="100px;" alt=""/><br /><sub><b>Sivasubramani M</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=sivasubramanim" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/d4gg4d"><img src="https://avatars2.githubusercontent.com/u/99457?v=4" width="100px;" alt=""/><br /><sub><b>Sami Airaksinen</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=d4gg4d" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vertti"><img src="https://avatars0.githubusercontent.com/u/557751?v=4" width="100px;" alt=""/><br /><sub><b>Janne Sinivirta</b></sub></a><br /><a href="https://github.com/iluwatar/java-design-patterns/commits?author=vertti" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Bobo1239"><img src="https://avatars1.githubusercontent.com/u/2302947?v=4" width="100px;" alt=""/><br /><sub><b>Boris-Chengbiao Zhou</b></sub></a><br /><a href="#content-Bobo1239" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center"><a href="https://jahhein.github.io"><img src="https://avatars2.githubusercontent.com/u/10779515?v=4" width="100px;" alt=""/><br /><sub><b>Jacob Hein</b></sub></a><br /><a href="#content-Jahhein" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/iamrichardjones"><img src="https://avatars3.githubusercontent.com/u/14842151?v=4" width="100px;" alt=""/><br /><sub><b>Richard Jones</b></sub></a><br /><a href="#content-iamrichardjones" title="Content">🖋</a></td>
<td align="center"><a href="https://rachelcarmena.github.io"><img src="https://avatars0.githubusercontent.com/u/22792183?v=4" width="100px;" alt=""/><br /><sub><b>Rachel M. Carmena</b></sub></a><br /><a href="#content-rachelcarmena" title="Content">🖋</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

View File

@ -5,13 +5,13 @@ folder: abstract-document
permalink: /patterns/abstract-document/
categories: Structural
tags:
- Java
- Difficulty-Intermediate
- Extensibility
---
## Intent
Achieve flexibility of untyped languages and keep the type-safety
## Class diagram
![alt text](./etc/abstract-document.png "Abstract Document Traits and Domain")
@ -26,4 +26,4 @@ Use the Abstract Document Pattern when
## Credits
* [Wikipedia: Abstract Document Pattern](https://en.wikipedia.org/wiki/Abstract_Document_Pattern)
* [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf)
* [Martin Fowler: Dealing with properties](http://martinfowler.com/apsupp/properties.pdf)

View File

@ -0,0 +1,65 @@
@startuml
package com.iluwatar.abstractdocument.domain.enums {
enum Property {
+ MODEL {static}
+ PARTS {static}
+ PRICE {static}
+ TYPE {static}
+ valueOf(name : String) : Property {static}
+ values() : Property[] {static}
}
}
package com.iluwatar.abstractdocument.domain {
class Car {
+ Car(properties : Map<String, Object>)
}
interface HasModel {
+ getModel() : Optional<String>
}
interface HasParts {
+ getParts() : Stream<Part>
}
interface HasPrice {
+ getPrice() : Optional<Number>
}
interface HasType {
+ getType() : Optional<String>
}
class Part {
+ Part(properties : Map<String, Object>)
}
}
package com.iluwatar.abstractdocument {
abstract class AbstractDocument {
- properties : Map<String, Object>
# AbstractDocument(properties : Map<String, Object>)
+ children(key : String, constructor : Function<Map<String, Object>, T>) : Stream<T>
+ get(key : String) : Object
+ 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 ..|> Document
Car ..|> HasModel
Car ..|> HasPrice
Car ..|> HasParts
Car --|> AbstractDocument
HasModel --|> Document
HasParts --|> Document
HasPrice --|> Document
HasType --|> Document
Part ..|> HasType
Part ..|> HasModel
Part ..|> HasPrice
Part --|> AbstractDocument
@enduml

View File

@ -1,47 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-document</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>java-design-patterns</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-document</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Maven assembly plugin is invoked with default setting which we have
in parent pom and specifying the class having main method -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.abstractdocument.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -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
@ -20,17 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
/**
* Abstract implementation of Document interface
* Abstract implementation of Document interface.
*/
public abstract class AbstractDocument implements Document {
@ -54,17 +55,21 @@ public abstract class AbstractDocument implements Document {
@Override
public <T> Stream<T> children(String key, Function<Map<String, Object>, T> constructor) {
Optional<List<Map<String, Object>>> any = Stream.of(get(key)).filter(el -> el != null)
.map(el -> (List<Map<String, Object>>) el).findAny();
return any.isPresent() ? any.get().stream().map(constructor) : Stream.empty();
return Stream.ofNullable(get(key))
.filter(Objects::nonNull)
.map(el -> (List<Map<String, Object>>) el)
.findAny()
.stream()
.flatMap(Collection::stream)
.map(constructor);
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
var builder = new StringBuilder();
builder.append(getClass().getName()).append("[");
properties.entrySet()
.forEach(e -> builder.append("[").append(e.getKey()).append(" : ").append(e.getValue()).append("]"));
properties.forEach((key, value) -> builder.append("[").append(key).append(" : ").append(value)
.append("]"));
builder.append("]");
return builder.toString();
}

View File

@ -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
@ -20,67 +20,64 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;
import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.HasModel;
import com.iluwatar.abstractdocument.domain.HasParts;
import com.iluwatar.abstractdocument.domain.HasPrice;
import com.iluwatar.abstractdocument.domain.HasType;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* The Abstract Document pattern enables handling additional, non-static
* properties. This pattern uses concept of traits to enable type safety and
* separate properties of different classes into set of interfaces.
* <p>
* <p>
* In Abstract Document pattern,({@link AbstractDocument}) fully implements
* {@link Document}) interface. Traits are then defined to enable access to
* properties in usual, static way.
* The Abstract Document pattern enables handling additional, non-static properties. This pattern
* uses concept of traits to enable type safety and separate properties of different classes into
* set of interfaces.
*
* <p>In Abstract Document pattern,({@link AbstractDocument}) fully implements {@link Document})
* interface. Traits are then defined to enable access to properties in usual, static way.
*/
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
* Executes the App
* Executes the App.
*/
public App() {
LOGGER.info("Constructing parts and car");
Map<String, Object> carProperties = new HashMap<>();
carProperties.put(HasModel.PROPERTY, "300SL");
carProperties.put(HasPrice.PROPERTY, 10000L);
var wheelProperties = Map.of(
Property.TYPE.toString(), "wheel",
Property.MODEL.toString(), "15C",
Property.PRICE.toString(), 100L);
Map<String, Object> wheelProperties = new HashMap<>();
wheelProperties.put(HasType.PROPERTY, "wheel");
wheelProperties.put(HasModel.PROPERTY, "15C");
wheelProperties.put(HasPrice.PROPERTY, 100L);
var doorProperties = Map.of(
Property.TYPE.toString(), "door",
Property.MODEL.toString(), "Lambo",
Property.PRICE.toString(), 300L);
Map<String, Object> doorProperties = new HashMap<>();
doorProperties.put(HasType.PROPERTY, "door");
doorProperties.put(HasModel.PROPERTY, "Lambo");
doorProperties.put(HasPrice.PROPERTY, 300L);
var carProperties = Map.of(
Property.MODEL.toString(), "300SL",
Property.PRICE.toString(), 10000L,
Property.PARTS.toString(), List.of(wheelProperties, doorProperties));
carProperties.put(HasParts.PROPERTY, 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());
LOGGER.info("-> price: {}", car.getPrice().get());
LOGGER.info("-> model: {}", car.getModel().orElseThrow());
LOGGER.info("-> price: {}", car.getPrice().orElseThrow());
LOGGER.info("-> parts: ");
car.getParts().forEach(p -> LOGGER.info("\t{}/{}/{}", p.getType().get(), p.getModel().get(), p.getPrice().get()));
car.getParts().forEach(p -> LOGGER.info("\t{}/{}/{}",
p.getType().orElse(null),
p.getModel().orElse(null),
p.getPrice().orElse(null))
);
}
/**
* Program entry point
* Program entry point.
*
* @param args command line args
*/

View File

@ -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
@ -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;
@ -27,12 +28,12 @@ import java.util.function.Function;
import java.util.stream.Stream;
/**
* Document interface
* Document interface.
*/
public interface Document {
/**
* Puts the value related to the key
* Puts the value related to the key.
*
* @param key element key
* @param value element value
@ -41,7 +42,7 @@ public interface Document {
Void put(String key, Object value);
/**
* Gets the value for the key
* Gets the value for the key.
*
* @param key element key
* @return value or null
@ -49,7 +50,7 @@ public interface Document {
Object get(String key);
/**
* Gets the stream of child documents
* Gets the stream of child documents.
*
* @param key element key
* @param constructor constructor of child class

View File

@ -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
@ -20,14 +20,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.AbstractDocument;
import java.util.Map;
import com.iluwatar.abstractdocument.AbstractDocument;
/**
* Car entity
* Car entity.
*/
public class Car extends AbstractDocument implements HasModel, HasPrice, HasParts {

View File

@ -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
@ -20,21 +20,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.Document;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.Optional;
import com.iluwatar.abstractdocument.Document;
/**
* HasModel trait for static access to 'model' property
* HasModel trait for static access to 'model' property.
*/
public interface HasModel extends Document {
String PROPERTY = "model";
default Optional<String> getModel() {
return Optional.ofNullable((String) get(PROPERTY));
return Optional.ofNullable((String) get(Property.MODEL.toString()));
}
}

View File

@ -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
@ -20,21 +20,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.Document;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.stream.Stream;
import com.iluwatar.abstractdocument.Document;
/**
* HasParts trait for static access to 'parts' property
* HasParts trait for static access to 'parts' property.
*/
public interface HasParts extends Document {
String PROPERTY = "parts";
default Stream<Part> getParts() {
return children(PROPERTY, Part::new);
return children(Property.PARTS.toString(), Part::new);
}
}

View File

@ -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
@ -20,21 +20,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.Document;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.Optional;
import com.iluwatar.abstractdocument.Document;
/**
* HasPrice trait for static access to 'price' property
* HasPrice trait for static access to 'price' property.
*/
public interface HasPrice extends Document {
String PROPERTY = "price";
default Optional<Number> getPrice() {
return Optional.ofNullable((Number) get(PROPERTY));
return Optional.ofNullable((Number) get(Property.PRICE.toString()));
}
}

View File

@ -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
@ -20,21 +20,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.Document;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.Optional;
/**
* HasType trait for static access to 'type' property
* HasType trait for static access to 'type' property.
*/
public interface HasType extends Document {
String PROPERTY = "type";
default Optional<String> getType() {
return Optional.ofNullable((String) get(PROPERTY));
return Optional.ofNullable((String) get(Property.TYPE.toString()));
}
}

View File

@ -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
@ -20,14 +20,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain;
import com.iluwatar.abstractdocument.AbstractDocument;
import java.util.Map;
import com.iluwatar.abstractdocument.AbstractDocument;
/**
* Part entity
* Part entity.
*/
public class Part extends AbstractDocument implements HasType, HasModel, HasPrice {

View File

@ -0,0 +1,32 @@
/*
* The MIT License
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument.domain.enums;
/**
* Enum To Describe Property type.
*/
public enum Property {
PARTS, TYPE, PRICE, MODEL
}

View File

@ -0,0 +1,26 @@
/*
* The MIT License
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module com.iluwatar.abstractdocument {
requires org.slf4j;
}

View File

@ -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
@ -20,18 +20,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;
/**
* AbstractDocument test class
@ -58,31 +57,28 @@ public class AbstractDocumentTest {
@Test
public void shouldRetrieveChildren() {
Map<String, Object> child1 = new HashMap<>();
Map<String, Object> child2 = new HashMap<>();
List<Map<String, Object>> children = Arrays.asList(child1, child2);
var children = List.of(Map.of(), Map.of());
document.put(KEY, children);
Stream<DocumentImplementation> childrenStream = document.children(KEY, DocumentImplementation::new);
var childrenStream = document.children(KEY, DocumentImplementation::new);
assertNotNull(children);
assertEquals(2, childrenStream.count());
}
@Test
public void shouldRetrieveEmptyStreamForNonExistingChildren() {
Stream<DocumentImplementation> children = document.children(KEY, DocumentImplementation::new);
var children = document.children(KEY, DocumentImplementation::new);
assertNotNull(children);
assertEquals(0, children.count());
}
@Test
public void shouldIncludePropsInToString() {
Map<String, Object> props = new HashMap<>();
props.put(KEY, VALUE);
DocumentImplementation document = new DocumentImplementation(props);
assertNotNull(document.toString().contains(KEY));
assertNotNull(document.toString().contains(VALUE));
var props = Map.of(KEY, (Object) VALUE);
var document = new DocumentImplementation(props);
assertTrue(document.toString().contains(KEY));
assertTrue(document.toString().contains(VALUE));
}
}

View File

@ -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
@ -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 org.junit.jupiter.api.Test;

View File

@ -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
@ -20,22 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractdocument;
import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.HasModel;
import com.iluwatar.abstractdocument.domain.HasParts;
import com.iluwatar.abstractdocument.domain.HasPrice;
import com.iluwatar.abstractdocument.domain.HasType;
import com.iluwatar.abstractdocument.domain.Part;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.iluwatar.abstractdocument.domain.Car;
import com.iluwatar.abstractdocument.domain.Part;
import com.iluwatar.abstractdocument.domain.enums.Property;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;
/**
* Test for Part and Car
*/
@ -50,27 +46,27 @@ public class DomainTest {
@Test
public void shouldConstructPart() {
Map<String, Object> partProperties = new HashMap<>();
partProperties.put(HasType.PROPERTY, TEST_PART_TYPE);
partProperties.put(HasModel.PROPERTY, TEST_PART_MODEL);
partProperties.put(HasPrice.PROPERTY, TEST_PART_PRICE);
Part part = new Part(partProperties);
assertEquals(TEST_PART_TYPE, part.getType().get());
assertEquals(TEST_PART_MODEL, part.getModel().get());
assertEquals(TEST_PART_PRICE, part.getPrice().get());
var partProperties = Map.of(
Property.TYPE.toString(), TEST_PART_TYPE,
Property.MODEL.toString(), TEST_PART_MODEL,
Property.PRICE.toString(), (Object) TEST_PART_PRICE
);
var part = new Part(partProperties);
assertEquals(TEST_PART_TYPE, part.getType().orElseThrow());
assertEquals(TEST_PART_MODEL, part.getModel().orElseThrow());
assertEquals(TEST_PART_PRICE, part.getPrice().orElseThrow());
}
@Test
public void shouldConstructCar() {
Map<String, Object> carProperties = new HashMap<>();
carProperties.put(HasModel.PROPERTY, TEST_CAR_MODEL);
carProperties.put(HasPrice.PROPERTY, TEST_CAR_PRICE);
carProperties.put(HasParts.PROPERTY, Arrays.asList(new HashMap<>(), new HashMap<>()));
Car car = new Car(carProperties);
assertEquals(TEST_CAR_MODEL, car.getModel().get());
assertEquals(TEST_CAR_PRICE, car.getPrice().get());
var carProperties = Map.of(
Property.MODEL.toString(), TEST_CAR_MODEL,
Property.PRICE.toString(), TEST_CAR_PRICE,
Property.PARTS.toString(), List.of(Map.of(), Map.of())
);
var car = new Car(carProperties);
assertEquals(TEST_CAR_MODEL, car.getModel().orElseThrow());
assertEquals(TEST_CAR_PRICE, car.getPrice().orElseThrow());
assertEquals(2, car.getParts().count());
}

View File

@ -5,9 +5,7 @@ folder: abstract-factory
permalink: /patterns/abstract-factory/
categories: Creational
tags:
- Java
- Gang Of Four
- Difficulty-Intermediate
- Gang of Four
---
## Also known as
@ -109,10 +107,10 @@ public class OrcKingdomFactory implements KingdomFactory {
Now we have our abstract factory that lets us make family of related objects i.e. Elven kingdom factory creates Elven castle, king and army etc.
```java
KingdomFactory factory = new ElfKingdomFactory();
Castle castle = factory.createCastle();
King king = factory.createKing();
Army army = factory.createArmy();
var factory = new ElfKingdomFactory();
var castle = factory.createCastle();
var king = factory.createKing();
var army = factory.createArmy();
castle.getDescription(); // Output: This is the Elven castle!
king.getDescription(); // Output: This is the Elven king!
@ -143,7 +141,7 @@ public static class FactoryMaker {
}
public static void main(String[] args) {
App app = new App();
var app = new App();
LOGGER.info("Elf Kingdom");
app.createKingdom(FactoryMaker.makeFactory(KingdomType.ELF));
@ -157,6 +155,9 @@ public static void main(String[] args) {
}
```
## Class diagram
![alt text](./etc/abstract-factory.urm.png "Abstract Factory class diagram")
## Applicability
Use the Abstract Factory pattern when
@ -169,24 +170,25 @@ Use the Abstract Factory pattern when
* you need a run-time value to construct a particular dependency
* you want to decide which product to call from a family at runtime.
* you need to supply one or more parameters only known at run-time before you can resolve a dependency.
* when you need consistency among products
* you dont want to change existing code when adding new products or families of products to the program.
## Use Cases:
* Selecting to call the appropriate implementation of FileSystemAcmeService or DatabaseAcmeService or NetworkAcmeService at runtime.
* Unit test case writing becomes much easier
* UI tools for different OS
## Consequences:
* Dependency injection in java hides the service class dependencies that can lead to runtime errors that would have been caught at compile time.
* While the pattern is great when creating predefined objects, adding the new ones might be challenging.
* The code may become more complicated than it should be, since a lot of new interfaces and classes are introduced along with the pattern.
## Tutorial
* [Abstract Factory Pattern Tutorial](https://www.journaldev.com/1418/abstract-factory-design-pattern-in-java)
## Presentations
* [Abstract Factory Pattern](etc/presentation.html)
## Real world examples
@ -196,4 +198,5 @@ Use the Abstract Factory pattern when
## Credits
* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://www.amazon.com/gp/product/0201633612/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0201633612&linkCode=as2&tag=javadesignpat-20&linkId=675d49790ce11db99d90bde47f1aeb59)
* [Head First Design Patterns: A Brain-Friendly Guide](https://www.amazon.com/gp/product/0596007124/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596007124&linkCode=as2&tag=javadesignpat-20&linkId=6b8b6eea86021af6c8e3cd3fc382cb5b)

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@ -0,0 +1,101 @@
@startuml
package com.iluwatar.abstractfactory {
class App {
- LOGGER : Logger {static}
- army : Army
- castle : Castle
- king : King
+ App()
+ createKingdom(factory : KingdomFactory)
+ getArmy() : Army
~ getArmy(factory : KingdomFactory) : Army
+ getCastle() : Castle
~ getCastle(factory : KingdomFactory) : Castle
+ getKing() : King
~ getKing(factory : KingdomFactory) : King
+ main(args : String[]) {static}
- setArmy(army : Army)
- setCastle(castle : Castle)
- setKing(king : King)
}
class FactoryMaker {
+ FactoryMaker()
+ makeFactory(type : KingdomType) : KingdomFactory {static}
}
enum KingdomType {
+ ELF {static}
+ ORC {static}
+ valueOf(name : String) : KingdomType {static}
+ values() : KingdomType[] {static}
}
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 ElfKing {
~ DESCRIPTION : String {static}
+ 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 OrcArmy {
~ DESCRIPTION : String {static}
+ OrcArmy()
+ getDescription() : String
}
class OrcCastle {
~ DESCRIPTION : String {static}
+ OrcCastle()
+ getDescription() : String
}
class OrcKing {
~ DESCRIPTION : String {static}
+ OrcKing()
+ getDescription() : String
}
class OrcKingdomFactory {
+ OrcKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
}
}
KingdomType ..+ FactoryMaker
App --> "-castle" Castle
FactoryMaker ..+ App
App --> "-king" King
App --> "-army" Army
ElfArmy ..|> Army
ElfCastle ..|> Castle
ElfKing ..|> King
ElfKingdomFactory ..|> KingdomFactory
OrcArmy ..|> Army
OrcCastle ..|> Castle
OrcKing ..|> King
OrcKingdomFactory ..|> KingdomFactory
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,190 +0,0 @@
<!--
The MIT License
Copyright (c) 2017 Rodolfo Forte
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!DOCTYPE html>
<html>
<head>
<title>Design Patterns - Abstract Factory Presentation</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
blockquote {
border-left: 0.3em solid rgba(0,0,0,0.5);
padding: 0 15px;
font-style: italic;
}
img {
max-width:100%;
}
</style>
</head>
<body>
<textarea id="source">
class: center, middle
# Abstract Factory
---
# Also known as
* Kit
---
# Intent
* Provide an interface for creating families of related or dependent objects without specifying their concrete classes
---
# Explanation
* [Wikipedia](https://en.wikipedia.org/wiki/Abstract_factory_pattern) says:
> "The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes"
<br />
* In plain words:
* A factory that groups individual but related/dependent factories together without specifying their concrete classes;
* A factory of factories;
---
# Example
* In a factory that creates kingdoms, we need objects with common theme:
* Elven kingdom needs an Elven king, Elven castle and Elven army;
* Orcish kingdom needs an Orcish king, Orcish castle and Orcish army;
<br />
* There is a dependency between the objects in the kingdom;
---
# Diagram
* Based on the kingdom example, the diagram below showcases the different concrete factories and their concrete products:
.center[![Diagram](diagram1.png)]
---
# Diagram
* The class diagram below showcases the factory of factories;
* At runtime, we can define which Kingdom type is needed and pass it as a parameter to define which concrete KingdomFactory to instantiate;
* The concrete factory returned will then be able to produce the related objects of the specified type;
.center[![Diagram](diagram2.png)]
---
# Applicability
Use the Abstract Factory pattern when:
* A system should be independent of how its products are created, composed and represented;
* A system should be configured with one of multiple families of products;
* A family of related product objects is designed to be used together, and you need to enforce this constraint;
* You want to provide a class library of products, and you want to reveal just their interfaces, not their implementations;
---
# Applicability
Use the Abstract Factory pattern when:
* The lifetime of the dependency is conceptually shorter than the lifetime of the consumer;
* You need a run-time value to construct a particular dependency;
* You want to decide which product to call from a family at runtime;
* You need to supply one or more parameters only known at run-time before you can resolve a dependency;
---
#Use Cases
* Selecting to call the appropriate implementation of FileSystemAcmeService or DatabaseAcmeService or NetworkAcmeService at runtime;
* Unit test case writing becomes much easier;
---
# Consequences
* Dependency injection in java hides the service class dependencies that can lead to runtime errors that would have been caught at compile time
---
# Real world examples
[javax.xml.parsers.DocumentBuilderFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/DocumentBuilderFactory.html)
[javax.xml.transform.TransformerFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/transform/TransformerFactory.html#newInstance--)
[javax.xml.xpath.XPathFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/XPathFactory.html#newInstance--)
---
# Credits
* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)
---
# Tutorials
* Source code http://java-design-patterns.com/patterns/abstract-factory/
</textarea>
<script src="https://gnab.github.io/remark/downloads/remark-latest.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>

View File

@ -1,47 +1,56 @@
<?xml version="1.0"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-factory</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<artifactId>abstract-factory</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Maven assembly plugin is invoked with default setting which we have
in parent pom and specifying the class having main method -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.abstractfactory.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,27 +20,26 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
import com.iluwatar.abstractfactory.App.FactoryMaker.KingdomType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.iluwatar.abstractfactory.App.FactoryMaker.KingdomType;
/**
*
* The Abstract Factory pattern provides a way to encapsulate a group of individual factories that have a common theme
* without specifying their concrete classes. In normal usage, the client software creates a concrete implementation of
* the abstract factory and then uses the generic interface of the factory to create the concrete objects that are part
* of the theme. The client does not know (or care) which concrete objects it gets from each of these internal
* factories, since it uses only the generic interfaces of their products. This pattern separates the details of
* implementation of a set of objects from their general usage and relies on object composition, as object creation is
* implemented in methods exposed in the factory interface.
* <p>
* The essence of the Abstract Factory pattern is a factory interface ({@link KingdomFactory}) and its implementations (
* {@link ElfKingdomFactory}, {@link OrcKingdomFactory}). The example uses both concrete implementations to create a
* king, a castle and an army.
*
* The Abstract Factory pattern provides a way to encapsulate a group of individual factories that
* have a common theme without specifying their concrete classes. In normal usage, the client
* software creates a concrete implementation of the abstract factory and then uses the generic
* interface of the factory to create the concrete objects that are part of the theme. The client
* does not know (or care) which concrete objects it gets from each of these internal factories,
* since it uses only the generic interfaces of their products. This pattern separates the details
* of implementation of a set of objects from their general usage and relies on object composition,
* as object creation is implemented in methods exposed in the factory interface.
*
* <p>The essence of the Abstract Factory pattern is a factory interface ({@link KingdomFactory})
* and its implementations ( {@link ElfKingdomFactory}, {@link OrcKingdomFactory}). The example uses
* both concrete implementations to create a king, a castle and an army.
*/
public class App {
@ -51,14 +50,14 @@ public class App {
private Army army;
/**
* Creates kingdom
* Creates kingdom.
*/
public void createKingdom(final KingdomFactory factory) {
setKing(factory.createKing());
setCastle(factory.createCastle());
setArmy(factory.createArmy());
}
King getKing(final KingdomFactory factory) {
return factory.createKing();
}
@ -70,7 +69,7 @@ public class App {
private void setKing(final King king) {
this.king = king;
}
Castle getCastle(final KingdomFactory factory) {
return factory.createCastle();
}
@ -82,7 +81,7 @@ public class App {
private void setCastle(final Castle castle) {
this.castle = castle;
}
Army getArmy(final KingdomFactory factory) {
return factory.createArmy();
}
@ -124,13 +123,12 @@ public class App {
/**
* Program entry point.
*
* @param args
* command line args
*
* @param args command line args
*/
public static void main(String[] args) {
App app = new App();
var app = new App();
LOGGER.info("Elf Kingdom");
app.createKingdom(FactoryMaker.makeFactory(KingdomType.ELF));

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* Army interface
*
* Army interface.
*/
public interface Army {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* Castle interface
*
* Castle interface.
*/
public interface Castle {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* ElfArmy
*
* ElfArmy.
*/
public class ElfArmy implements Army {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* ElfCastle
*
* ElfCastle.
*/
public class ElfCastle implements Castle {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* ElfKing
*
* ElfKing.
*/
public class ElfKing implements King {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,23 +20,25 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* ElfKingdomFactory concrete factory.
*
*/
public class ElfKingdomFactory implements KingdomFactory {
@Override
public Castle createCastle() {
return new ElfCastle();
}
@Override
public King createKing() {
return new ElfKing();
}
@Override
public Army createArmy() {
return new ElfArmy();
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* King interface
*
* King interface.
*/
public interface King {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* KingdomFactory factory interface.
*
*/
public interface KingdomFactory {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* OrcArmy
*
* OrcArmy.
*/
public class OrcArmy implements Army {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* OrcCastle
*
* OrcCastle.
*/
public class OrcCastle implements Castle {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* OrcKing
*
* OrcKing.
*/
public class OrcKing implements King {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,23 +20,25 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
/**
*
* OrcKingdomFactory concrete factory.
*
*/
public class OrcKingdomFactory implements KingdomFactory {
@Override
public Castle createCastle() {
return new OrcCastle();
}
@Override
public King createKing() {
return new OrcKing();
}
@Override
public Army createArmy() {
return new OrcArmy();
}

View File

@ -0,0 +1,26 @@
/*
* The MIT License
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module com.iluwatar.abstractfactory {
requires org.slf4j;
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ -27,12 +28,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import com.iluwatar.abstractfactory.App.FactoryMaker;
import com.iluwatar.abstractfactory.App.FactoryMaker.KingdomType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Test for abstract factory
* Test for abstract factory.
*/
public class AbstractFactoryTest {
@ -48,30 +48,30 @@ public class AbstractFactoryTest {
@Test
public void king() {
final King elfKing = app.getKing(elfFactory);
final var elfKing = app.getKing(elfFactory);
assertTrue(elfKing instanceof ElfKing);
assertEquals(ElfKing.DESCRIPTION, elfKing.getDescription());
final King orcKing = app.getKing(orcFactory);
final var orcKing = app.getKing(orcFactory);
assertTrue(orcKing instanceof OrcKing);
assertEquals(OrcKing.DESCRIPTION, orcKing.getDescription());
}
@Test
public void castle() {
final Castle elfCastle = app.getCastle(elfFactory);
final var elfCastle = app.getCastle(elfFactory);
assertTrue(elfCastle instanceof ElfCastle);
assertEquals(ElfCastle.DESCRIPTION, elfCastle.getDescription());
final Castle orcCastle = app.getCastle(orcFactory);
final var orcCastle = app.getCastle(orcFactory);
assertTrue(orcCastle instanceof OrcCastle);
assertEquals(OrcCastle.DESCRIPTION, orcCastle.getDescription());
}
@Test
public void army() {
final Army elfArmy = app.getArmy(elfFactory);
final var elfArmy = app.getArmy(elfFactory);
assertTrue(elfArmy instanceof ElfArmy);
assertEquals(ElfArmy.DESCRIPTION, elfArmy.getDescription());
final Army orcArmy = app.getArmy(orcFactory);
final var orcArmy = app.getArmy(orcFactory);
assertTrue(orcArmy instanceof OrcArmy);
assertEquals(OrcArmy.DESCRIPTION, orcArmy.getDescription());
}
@ -79,9 +79,9 @@ public class AbstractFactoryTest {
@Test
public void createElfKingdom() {
app.createKingdom(elfFactory);
final King king = app.getKing();
final Castle castle = app.getCastle();
final Army army = app.getArmy();
final var king = app.getKing();
final var castle = app.getCastle();
final var army = app.getArmy();
assertTrue(king instanceof ElfKing);
assertEquals(ElfKing.DESCRIPTION, king.getDescription());
assertTrue(castle instanceof ElfCastle);
@ -93,9 +93,9 @@ public class AbstractFactoryTest {
@Test
public void createOrcKingdom() {
app.createKingdom(orcFactory);
final King king = app.getKing();
final Castle castle = app.getCastle();
final Army army = app.getArmy();
final var king = app.getKing();
final var castle = app.getCastle();
final var army = app.getArmy();
assertTrue(king instanceof OrcKing);
assertEquals(OrcKing.DESCRIPTION, king.getDescription());
assertTrue(castle instanceof OrcCastle);

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,19 +20,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.abstractfactory;
import org.junit.jupiter.api.Test;
import java.io.IOException;
/**
* Tests that Abstract Factory example runs without errors.
*/
public class AppTest {
@Test
public void test() throws IOException {
String[] args = {};
App.main(args);
public void test() {
App.main(new String[]{});
}
}

View File

@ -5,17 +5,18 @@ folder: acyclic-visitor
permalink: /patterns/acyclic-visitor/
categories: Behavioral
tags:
- Java
- Difficulty-Intermediate
- Extensibility
---
![alt text](./etc/acyclic-visitor.png "Acyclic Visitor")
## Intent
Allow new functions to be added to existing class hierarchies without affecting those hierarchies, and without creating the troublesome dependency cycles that are inherent to the GOF VISITOR Pattern.
## Class diagram
![alt text](./etc/acyclic-visitor.png "Acyclic Visitor")
## Applicability
This pattern can be used:
* When you need to add a new function to an existing hierarchy without the need to alter or affect that hierarchy.
* When there are functions that operate upon a hierarchy, but which do not belong in the hierarchy itself. e.g. the ConfigureForDOS / ConfigureForUnix / ConfigureForX issue.
* When you need to perform very different operations on an object depending upon its type.
@ -24,16 +25,18 @@ This pattern can be used:
## Consequences
The good:
* No dependency cycles between class hierarchies.
* No need to recompile all the visitors if a new one is added.
* Does not cause compilation failure in existing visitors if class hierarchy has a new member.
The bad:
* Violates the principle of least surprise or Liskov's Substitution principle by showing that it can accept all visitors but actually only being interested in particular visitors.
* Parallel hierarchy of visitors has to be created for all members in visitable class hierarchy.
## Related patterns
* [Visitor Pattern](../visitor/README.md)
* [Visitor Pattern](../visitor/)
## Credits
* [Acyclic Visitor](http://condor.depaul.edu/dmumaugh/OOT/Design-Principles/acv.pdf)
* [Acyclic Visitor](http://condor.depaul.edu/dmumaugh/OOT/Design-Principles/acv.pdf)

View File

@ -0,0 +1,53 @@
@startuml
package com.iluwatar.acyclicvisitor {
interface AllModemVisitor {
}
class App {
+ App()
+ main(args : String[]) {static}
}
class ConfigureForDosVisitor {
- LOGGER : Logger {static}
+ ConfigureForDosVisitor()
+ visit(hayes : Hayes)
+ visit(zoom : Zoom)
}
class ConfigureForUnixVisitor {
- LOGGER : Logger {static}
+ ConfigureForUnixVisitor()
+ visit(zoom : Zoom)
}
class Hayes {
- LOGGER : Logger {static}
+ Hayes()
+ accept(modemVisitor : ModemVisitor)
+ toString() : String
}
interface HayesVisitor {
+ visit(Hayes) {abstract}
}
abstract class Modem {
+ Modem()
+ accept(ModemVisitor) {abstract}
}
interface ModemVisitor {
}
class Zoom {
- LOGGER : Logger {static}
+ Zoom()
+ accept(modemVisitor : ModemVisitor)
+ toString() : String
}
interface ZoomVisitor {
+ visit(Zoom) {abstract}
}
}
AllModemVisitor --|> ZoomVisitor
AllModemVisitor --|> HayesVisitor
ConfigureForDosVisitor ..|> AllModemVisitor
ConfigureForUnixVisitor ..|> ZoomVisitor
Hayes --|> Modem
HayesVisitor --|> ModemVisitor
Zoom --|> Modem
ZoomVisitor --|> ModemVisitor
@enduml

View File

@ -1,38 +1,29 @@
<!--
The MIT License
Copyright (c) 2014 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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.21.0-SNAPSHOT</version>
<version>1.23.0-SNAPSHOT</version>
</parent>
<artifactId>acyclic-visitor</artifactId>
<properties>
@ -53,24 +44,40 @@
<dependency>
<groupId>uk.org.lidalia</groupId>
<artifactId>slf4j-test</artifactId>
<version>1.0.0</version>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Maven assembly plugin is invoked with default setting which we have
in parent pom and specifying the class having main method -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.acyclicvisitor.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* All ModemVisitor interface extends all visitor interfaces. This interface
* provides ease of use when a visitor needs to visit all modem types.
* All ModemVisitor interface extends all visitor interfaces. This interface provides ease of use
* when a visitor needs to visit all modem types.
*/
public interface AllModemVisitor extends ZoomVisitor, HayesVisitor{
public interface AllModemVisitor extends ZoomVisitor, HayesVisitor {
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,34 +20,33 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* The Acyclic Visitor pattern allows new functions to be added to existing class
* hierarchies without affecting those hierarchies, and without creating the dependency
* cycles that are inherent to the GoF Visitor pattern, by making the Visitor base class
* degenerate
* <p>
* In this example the visitor base class is {@link ModemVisitor}. The base class of the
* visited hierarchy is {@link Modem} and has two children {@link Hayes} and {@link Zoom}
* each one having its own visitor interface {@link HayesVisitor} and {@link ZoomVisitor}
* respectively. {@link ConfigureForUnixVisitor} and {@link ConfigureForDosVisitor}
* implement each derivative's visit method only if it is required
* The Acyclic Visitor pattern allows new functions to be added to existing class hierarchies
* without affecting those hierarchies, and without creating the dependency cycles that are inherent
* to the GoF Visitor pattern, by making the Visitor base class degenerate
*
* <p>In this example the visitor base class is {@link ModemVisitor}. The base class of the visited
* hierarchy is {@link Modem} and has two children {@link Hayes} and {@link Zoom} each one having
* its own visitor interface {@link HayesVisitor} and {@link ZoomVisitor} respectively. {@link
* ConfigureForUnixVisitor} and {@link ConfigureForDosVisitor} implement each derivative's visit
* method only if it is required
*/
public class App {
/**
* Program's entry point
* Program's entry point.
*/
public static void main(String[] args) {
ConfigureForUnixVisitor conUnix = new ConfigureForUnixVisitor();
ConfigureForDosVisitor conDos = new ConfigureForDosVisitor();
Zoom zoom = new Zoom();
Hayes hayes = new Hayes();
hayes.accept(conDos); // Hayes modem with Unix configurator
public static void main(String[] args) {
var conUnix = new ConfigureForUnixVisitor();
var conDos = new ConfigureForDosVisitor();
var zoom = new Zoom();
var hayes = new Hayes();
hayes.accept(conDos); // Hayes modem with Dos configurator
zoom.accept(conDos); // Zoom modem with Dos configurator
hayes.accept(conUnix); // Hayes modem with Unix configurator
zoom.accept(conUnix); // Zoom modem with Unix configurator

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,23 +20,26 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* ConfigureForDosVisitor class implements both zoom's and hayes' visit method
* for Dos manufacturer
* ConfigureForDosVisitor class implements both zoom's and hayes' visit method for Dos
* manufacturer.
*/
public class ConfigureForDosVisitor implements AllModemVisitor {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);
@Override
public void visit(Hayes hayes) {
LOGGER.info(hayes + " used with Dos configurator.");
}
@Override
public void visit(Zoom zoom) {
LOGGER.info(zoom + " used with Dos configurator.");
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,20 +20,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* ConfigureForUnixVisitor class implements zoom's visit method for Unix
* manufacturer, unlike traditional visitor pattern, this class may selectively implement
* visit for other modems.
* ConfigureForUnixVisitor class implements zoom's visit method for Unix manufacturer, unlike
* traditional visitor pattern, this class may selectively implement visit for other modems.
*/
public class ConfigureForUnixVisitor implements ZoomVisitor {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForUnixVisitor.class);
@Override
public void visit(Zoom zoom) {
LOGGER.info(zoom + " used with Unix configurator.");
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,20 +20,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Hayes class implements its accept method
* Hayes class implements its accept method.
*/
public class Hayes extends Modem {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);
/**
* Accepts all visitors but honors only HayesVisitor
* Accepts all visitors but honors only HayesVisitor.
*/
@Override
public void accept(ModemVisitor modemVisitor) {
@ -44,10 +45,9 @@ public class Hayes extends Modem {
}
}
/**
* Hayes' modem's toString
* method
* Hayes' modem's toString method.
*/
@Override
public String toString() {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,10 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* HayesVisitor interface
* HayesVisitor interface.
*/
public interface HayesVisitor extends ModemVisitor {
void visit(Hayes hayes);

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,10 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* Modem abstract class
* Modem abstract class.
*/
public abstract class Modem {
public abstract void accept(ModemVisitor modemVisitor);

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* ModemVisitor interface does not contain any visit methods so that it does not
* depend on the visited hierarchy. Each derivative's visit method is declared in
* its own visitor interface
* ModemVisitor interface does not contain any visit methods so that it does not depend on the
* visited hierarchy. Each derivative's visit method is declared in its own visitor interface
*/
public interface ModemVisitor {
// Visitor is a degenerate base class for all visitors.

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,33 +20,33 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Zoom class implements its accept method
* Zoom class implements its accept method.
*/
public class Zoom extends Modem {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);
/**
* Accepts all visitors but honors only ZoomVisitor
* Accepts all visitors but honors only ZoomVisitor.
*/
@Override
public void accept(ModemVisitor modemVisitor) {
if (modemVisitor instanceof ZoomVisitor) {
if (modemVisitor instanceof ZoomVisitor) {
((ZoomVisitor) modemVisitor).visit(this);
} else {
LOGGER.info("Only ZoomVisitor is allowed to visit Zoom modem");
}
}
/**
* Zoom modem's toString
* method
* Zoom modem's toString method.
*/
@Override
public String toString() {

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,10 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
/**
* ZoomVisitor interface
* ZoomVisitor interface.
*/
public interface ZoomVisitor extends ModemVisitor {
void visit(Zoom zoom);

View File

@ -0,0 +1,26 @@
/*
* The MIT License
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module com.iluwatar.acyclicvisitor {
requires org.slf4j;
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,20 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import org.junit.jupiter.api.Test;
import com.iluwatar.acyclicvisitor.App;
/**
* Tests that the Acyclic Visitor example runs without errors.
*/
public class AppTest {
@Test
public void test() {
String[] args = {};
App.main(args);
App.main(new String[]{});
}
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,22 +20,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.groups.Tuple.tuple;
import static org.mockito.Mockito.mock;
import static uk.org.lidalia.slf4jext.Level.INFO;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import com.iluwatar.acyclicvisitor.ConfigureForDosVisitor;
import com.iluwatar.acyclicvisitor.Hayes;
import com.iluwatar.acyclicvisitor.HayesVisitor;
import com.iluwatar.acyclicvisitor.Zoom;
import com.iluwatar.acyclicvisitor.ZoomVisitor;
import uk.org.lidalia.slf4jtest.TestLogger;
import uk.org.lidalia.slf4jtest.TestLoggerFactory;
@ -44,28 +37,30 @@ import uk.org.lidalia.slf4jtest.TestLoggerFactory;
*/
public class ConfigureForDosVisitorTest {
TestLogger logger = TestLoggerFactory.getTestLogger(ConfigureForDosVisitor.class);
private TestLogger logger = TestLoggerFactory.getTestLogger(ConfigureForDosVisitor.class);
@Test
public void testVisitForZoom() {
ConfigureForDosVisitor conDos = new ConfigureForDosVisitor();
Zoom zoom = new Zoom();
var conDos = new ConfigureForDosVisitor();
var zoom = new Zoom();
conDos.visit(zoom);
assertThat(logger.getLoggingEvents()).extracting("level", "message").contains(
tuple(INFO, zoom + " used with Dos configurator."));
assertThat(logger.getLoggingEvents())
.extracting("level", "message")
.contains(tuple(INFO, zoom + " used with Dos configurator."));
}
@Test
public void testVisitForHayes() {
ConfigureForDosVisitor conDos = new ConfigureForDosVisitor();
Hayes hayes = new Hayes();
var conDos = new ConfigureForDosVisitor();
var hayes = new Hayes();
conDos.visit(hayes);
assertThat(logger.getLoggingEvents()).extracting("level", "message").contains(
tuple(INFO, hayes + " used with Dos configurator."));
assertThat(logger.getLoggingEvents())
.extracting("level", "message")
.contains(tuple(INFO, hayes + " used with Dos configurator."));
}
@AfterEach

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,32 +20,25 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.groups.Tuple.tuple;
import static uk.org.lidalia.slf4jext.Level.INFO;
import static org.mockito.Mockito.mock;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import uk.org.lidalia.slf4jtest.TestLogger;
import uk.org.lidalia.slf4jtest.TestLoggerFactory;
import org.junit.jupiter.api.Test;
import com.iluwatar.acyclicvisitor.ConfigureForUnixVisitor;
import com.iluwatar.acyclicvisitor.Hayes;
import com.iluwatar.acyclicvisitor.HayesVisitor;
import com.iluwatar.acyclicvisitor.Zoom;
import com.iluwatar.acyclicvisitor.ZoomVisitor;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
/**
* ConfigureForUnixVisitor test class
*/
public class ConfigureForUnixVisitorTest {
TestLogger logger = TestLoggerFactory.getTestLogger(ConfigureForUnixVisitor.class);
private static final TestLogger LOGGER = TestLoggerFactory.getTestLogger(ConfigureForUnixVisitor.class);
@AfterEach
public void clearLoggers() {
@ -54,12 +47,13 @@ public class ConfigureForUnixVisitorTest {
@Test
public void testVisitForZoom() {
ConfigureForUnixVisitor conUnix = new ConfigureForUnixVisitor();
Zoom zoom = new Zoom();
var conUnix = new ConfigureForUnixVisitor();
var zoom = new Zoom();
conUnix.visit(zoom);
assertThat(logger.getLoggingEvents()).extracting("level", "message").contains(
tuple(INFO, zoom + " used with Unix configurator."));
assertThat(LOGGER.getLoggingEvents())
.extracting("level", "message")
.contains(tuple(INFO, zoom + " used with Unix configurator."));
}
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
import static org.mockito.Matchers.eq;
@ -29,11 +30,6 @@ import static org.mockito.Mockito.verifyZeroInteractions;
import org.junit.jupiter.api.Test;
import com.iluwatar.acyclicvisitor.ConfigureForDosVisitor;
import com.iluwatar.acyclicvisitor.ConfigureForUnixVisitor;
import com.iluwatar.acyclicvisitor.Hayes;
import com.iluwatar.acyclicvisitor.HayesVisitor;
/**
* Hayes test class
*/
@ -41,8 +37,8 @@ public class HayesTest {
@Test
public void testAcceptForDos() {
Hayes hayes = new Hayes();
ConfigureForDosVisitor mockVisitor = mock(ConfigureForDosVisitor.class);
var hayes = new Hayes();
var mockVisitor = mock(ConfigureForDosVisitor.class);
hayes.accept(mockVisitor);
verify((HayesVisitor)mockVisitor).visit(eq(hayes));
@ -50,8 +46,8 @@ public class HayesTest {
@Test
public void testAcceptForUnix() {
Hayes hayes = new Hayes();
ConfigureForUnixVisitor mockVisitor = mock(ConfigureForUnixVisitor.class);
var hayes = new Hayes();
var mockVisitor = mock(ConfigureForUnixVisitor.class);
hayes.accept(mockVisitor);

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.acyclicvisitor;
@ -29,11 +30,6 @@ import static org.mockito.Mockito.mock;
import org.junit.jupiter.api.Test;
import com.iluwatar.acyclicvisitor.ConfigureForDosVisitor;
import com.iluwatar.acyclicvisitor.ConfigureForUnixVisitor;
import com.iluwatar.acyclicvisitor.Zoom;
import com.iluwatar.acyclicvisitor.ZoomVisitor;
/**
* Zoom test class
*/
@ -41,8 +37,8 @@ public class ZoomTest {
@Test
public void testAcceptForDos() {
Zoom zoom = new Zoom();
ConfigureForDosVisitor mockVisitor = mock(ConfigureForDosVisitor.class);
var zoom = new Zoom();
var mockVisitor = mock(ConfigureForDosVisitor.class);
zoom.accept(mockVisitor);
verify((ZoomVisitor)mockVisitor).visit(eq(zoom));
@ -50,8 +46,8 @@ public class ZoomTest {
@Test
public void testAcceptForUnix() {
Zoom zoom = new Zoom();
ConfigureForUnixVisitor mockVisitor = mock(ConfigureForUnixVisitor.class);
var zoom = new Zoom();
var mockVisitor = mock(ConfigureForUnixVisitor.class);
zoom.accept(mockVisitor);
verify((ZoomVisitor)mockVisitor).visit(eq(zoom));

View File

@ -5,9 +5,7 @@ folder: adapter
permalink: /patterns/adapter/
categories: Structural
tags:
- Java
- Gang Of Four
- Difficulty-Beginner
- Gang of Four
---
## Also known as
@ -56,15 +54,14 @@ public class FishingBoat {
And captain expects an implementation of `RowingBoat` interface to be able to move
```java
public class Captain implements RowingBoat {
public class Captain {
private RowingBoat rowingBoat;
// default constructor and setter for rowingBoat
public Captain(RowingBoat rowingBoat) {
this.rowingBoat = rowingBoat;
}
@Override
public void row() {
rowingBoat.row();
}
@ -94,10 +91,13 @@ public class FishingBoatAdapter implements RowingBoat {
And now the `Captain` can use the `FishingBoat` to escape the pirates.
```java
Captain captain = new Captain(new FishingBoatAdapter());
var captain = new Captain(new FishingBoatAdapter());
captain.row();
```
## Class diagram
![alt text](./etc/adapter.urm.png "Adapter class diagram")
## Applicability
Use the Adapter pattern when
@ -129,5 +129,7 @@ An object adapter
## Credits
* [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612)
* [J2EE Design Patterns](http://www.amazon.com/J2EE-Design-Patterns-William-Crawford/dp/0596004273/ref=sr_1_2)
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://www.amazon.com/gp/product/0201633612/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0201633612&linkCode=as2&tag=javadesignpat-20&linkId=675d49790ce11db99d90bde47f1aeb59)
* [J2EE Design Patterns](https://www.amazon.com/gp/product/0596004273/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596004273&linkCode=as2&tag=javadesignpat-20&linkId=48d37c67fb3d845b802fa9b619ad8f31)
* [Head First Design Patterns: A Brain-Friendly Guide](https://www.amazon.com/gp/product/0596007124/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596007124&linkCode=as2&tag=javadesignpat-20&linkId=6b8b6eea86021af6c8e3cd3fc382cb5b)
* [Refactoring to Patterns](https://www.amazon.com/gp/product/0321213351/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0321213351&linkCode=as2&tag=javadesignpat-20&linkId=2a76fcb387234bc71b1c61150b3cc3a7)

BIN
adapter/etc/adapter.urm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,31 @@
@startuml
package com.iluwatar.adapter {
class App {
- App()
+ main(args : String[]) {static}
}
class Captain {
- rowingBoat : RowingBoat
+ Captain()
+ Captain(boat : RowingBoat)
~ row()
~ setRowingBoat(boat : RowingBoat)
}
~class FishingBoat {
- LOGGER : Logger {static}
~ FishingBoat()
~ sail()
}
class FishingBoatAdapter {
- boat : FishingBoat
+ FishingBoatAdapter()
+ row()
}
interface RowingBoat {
+ row() {abstract}
}
}
FishingBoatAdapter --> "-boat" FishingBoat
Captain --> "-rowingBoat" RowingBoat
FishingBoatAdapter ..|> RowingBoat
@enduml

View File

@ -1,52 +1,61 @@
<?xml version="1.0"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<artifactId>adapter</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<artifactId>adapter</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Maven assembly plugin is invoked with default setting which we have
in parent pom and specifying the class having main method -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.adapter.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
/**
@ -28,33 +29,33 @@ package com.iluwatar.adapter;
* The Adapter design pattern allows otherwise incompatible classes to work together by converting
* the interface of one class into an interface expected by the clients.
*
* <p>
* There are two variations of the Adapter pattern: The class adapter implements the adaptee's
* <p>There are two variations of the Adapter pattern: The class adapter implements the adaptee's
* interface whereas the object adapter uses composition to contain the adaptee in the adapter
* object. This example uses the object adapter approach.
*
* <p>
* The Adapter ({@link FishingBoatAdapter}) converts the interface of the adaptee class (
* {@link FishingBoat}) into a suitable one expected by the client ( {@link RowingBoat} ).
*
* <p>
* The story of this implementation is this. <br>
* Pirates are coming! we need a {@link RowingBoat} to flee! We have a {@link FishingBoat} and our
* captain. We have no time to make up a new ship! we need to reuse this {@link FishingBoat}. The
* captain needs a rowing boat which he can operate. The spec is in {@link RowingBoat}. We will
* use the Adapter pattern to reuse {@link FishingBoat}.
* <p>The Adapter ({@link FishingBoatAdapter}) converts the interface of the adaptee class ({@link
* FishingBoat}) into a suitable one expected by the client ({@link RowingBoat}).
*
* <p>The story of this implementation is this. <br> Pirates are coming! we need a {@link
* RowingBoat} to flee! We have a {@link FishingBoat} and our captain. We have no time to make up a
* new ship! we need to reuse this {@link FishingBoat}. The captain needs a rowing boat which he can
* operate. The spec is in {@link RowingBoat}. We will use the Adapter pattern to reuse {@link
* FishingBoat}.
*/
public class App {
public final class App {
private App() {
}
/**
* Program entry point.
*
* @param args command line args
*/
public static void main(String[] args) {
// The captain can only operate rowing boats but with adapter he is able to use fishing boats as well
Captain captain = new Captain(new FishingBoatAdapter());
public static void main(final String[] args) {
// The captain can only operate rowing boats but with adapter he is able to
// use fishing boats as well
var captain = new Captain(new FishingBoatAdapter());
captain.row();
}
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,27 +20,28 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
/**
* The Captain uses {@link RowingBoat} to sail. <br>
* This is the client in the pattern.
* The Captain uses {@link RowingBoat} to sail. <br> This is the client in the pattern.
*/
public class Captain {
public final class Captain {
private RowingBoat rowingBoat;
public Captain() {}
public Captain(RowingBoat rowingBoat) {
this.rowingBoat = rowingBoat;
public Captain() {
}
public void setRowingBoat(RowingBoat rowingBoat) {
this.rowingBoat = rowingBoat;
public Captain(final RowingBoat boat) {
this.rowingBoat = boat;
}
public void row() {
void setRowingBoat(final RowingBoat boat) {
this.rowingBoat = boat;
}
void row() {
rowingBoat.row();
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,22 +20,22 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
import static org.slf4j.LoggerFactory.getLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* Device class (adaptee in the pattern). We want to reuse this class.
* Fishing boat moves by sailing.
*
* Device class (adaptee in the pattern). We want to reuse this class. Fishing boat moves by
* sailing.
*/
public class FishingBoat {
final class FishingBoat {
private static final Logger LOGGER = LoggerFactory.getLogger(FishingBoat.class);
private static final Logger LOGGER = getLogger(FishingBoat.class);
public void sail() {
void sail() {
LOGGER.info("The fishing boat is sailing");
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,13 +20,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
/**
*
* Adapter class. Adapts the interface of the device ({@link FishingBoat}) into {@link RowingBoat}
* interface expected by the client ({@link Captain}).
*
*/
public class FishingBoatAdapter implements RowingBoat {
@ -36,8 +35,7 @@ public class FishingBoatAdapter implements RowingBoat {
boat = new FishingBoat();
}
@Override
public void row() {
public final void row() {
boat.sail();
}
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,12 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
/**
* The interface expected by the client.<br>
* A rowing boat is rowed to move.
*
* The interface expected by the client.<br> A rowing boat is rowed to move.
*/
public interface RowingBoat {

View File

@ -0,0 +1,24 @@
/*
* The MIT License
* 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:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,20 +20,19 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Test class
*
*/
public class AdapterPatternTest {
@ -50,29 +49,29 @@ public class AdapterPatternTest {
public void setup() {
beans = new HashMap<>();
FishingBoatAdapter fishingBoatAdapter = spy(new FishingBoatAdapter());
var fishingBoatAdapter = spy(new FishingBoatAdapter());
beans.put(FISHING_BEAN, fishingBoatAdapter);
Captain captain = new Captain();
var captain = new Captain();
captain.setRowingBoat((FishingBoatAdapter) beans.get(FISHING_BEAN));
beans.put(ROWING_BEAN, captain);
}
/**
* This test asserts that when we use the row() method on a captain bean(client), it is
* internally calling sail method on the fishing boat object. The Adapter ({@link FishingBoatAdapter}
* ) converts the interface of the target class ( {@link FishingBoat}) into a suitable one
* expected by the client ({@link Captain} ).
* This test asserts that when we use the row() method on a captain bean(client), it is internally
* calling sail method on the fishing boat object. The Adapter ({@link FishingBoatAdapter} )
* converts the interface of the target class ( {@link FishingBoat}) into a suitable one expected
* by the client ({@link Captain} ).
*/
@Test
public void testAdapter() {
Captain captain = (Captain) beans.get(ROWING_BEAN);
var captain = (Captain) beans.get(ROWING_BEAN);
// when captain moves
captain.row();
// the captain internally calls the battleship object to move
RowingBoat adapter = (RowingBoat) beans.get(FISHING_BEAN);
var adapter = (RowingBoat) beans.get(FISHING_BEAN);
verify(adapter).row();
}
}

View File

@ -1,6 +1,6 @@
/**
/*
* 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
@ -20,19 +20,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.adapter;
import org.junit.jupiter.api.Test;
import java.io.IOException;
/**
* Tests that Adapter example runs without errors.
*/
public class AppTest {
@Test
public void test() throws IOException {
String[] args = {};
App.main(args);
public void test() {
App.main(new String[]{});
}
}

View File

@ -5,8 +5,7 @@ folder: aggregator-microservices
permalink: /patterns/aggregator-microservices/
categories: Architectural
tags:
- Java
- Spring
- Cloud distributed
---
## Intent
@ -18,6 +17,8 @@ More variations of the aggregator are:
- Chained Microservice Design Pattern: In this case each microservice is dependent/ chained to a series
of other microservices.
## Class diagram
![alt text](./etc/aggregator-microservice.png "Aggregator Microservice")
## Applicability
@ -26,4 +27,4 @@ Use the Aggregator Microservices pattern when you need a unified API for various
## Credits
* [Microservice Design Patterns](http://blog.arungupta.me/microservice-design-patterns/)
* [Microservice Design Patterns](http://web.archive.org/web/20190705163602/http://blog.arungupta.me/microservice-design-patterns/)

View File

@ -0,0 +1,43 @@
@startuml
package com.iluwatar.aggregator.microservices {
class Aggregator {
- informationClient : ProductInformationClient
- inventoryClient : ProductInventoryClient
+ Aggregator()
+ getProduct() : Product
}
class App {
+ App()
+ main(args : String[]) {static}
}
class Product {
- productInventories : int
- title : String
+ Product()
+ getProductInventories() : int
+ getTitle() : String
+ setProductInventories(productInventories : int)
+ setTitle(title : String)
}
interface ProductInformationClient {
+ getProductTitle() : String {abstract}
}
class ProductInformationClientImpl {
- LOGGER : Logger {static}
+ ProductInformationClientImpl()
+ getProductTitle() : String
}
interface ProductInventoryClient {
+ getProductInventories() : Integer {abstract}
}
class ProductInventoryClientImpl {
- LOGGER : Logger {static}
+ ProductInventoryClientImpl()
+ getProductInventories() : Integer
}
}
Aggregator --> "-informationClient" ProductInformationClient
Aggregator --> "-inventoryClient" ProductInventoryClient
ProductInformationClientImpl ..|> ProductInformationClient
ProductInventoryClientImpl ..|> ProductInventoryClient
@enduml

View File

@ -1,93 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>aggregator-service</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<artifactId>aggregator-service</artifactId>
<packaging>jar</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Maven assembly plugin is invoked with default setting which we have
in parent pom and specifying the class having main method -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.aggregator.microservices.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -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
@ -20,16 +20,19 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static java.util.Objects.requireNonNullElse;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* The aggregator aggregates calls on various micro-services, collects
* data and further publishes them under a REST endpoint.
* The aggregator aggregates calls on various micro-services, collects data and further publishes
* them under a REST endpoint.
*/
@RestController
public class Aggregator {
@ -47,11 +50,19 @@ public class Aggregator {
*
* @return a Product.
*/
@RequestMapping("/product")
@RequestMapping(path = "/product", method = RequestMethod.GET)
public Product getProduct() {
Product product = new Product();
product.setTitle(informationClient.getProductTitle());
product.setProductInventories(inventoryClient.getProductInventories());
var product = new Product();
var productTitle = informationClient.getProductTitle();
var productInventory = inventoryClient.getProductInventories();
//Fallback to error message
product.setTitle(requireNonNullElse(productTitle, "Error: Fetching Product Title Failed"));
//Fallback to default error inventory
product.setProductInventories(requireNonNullElse(productInventory, -1));
return product;
}

View File

@ -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
@ -20,19 +20,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Spring Boot EntryPoint Class
* Spring Boot EntryPoint Class.
*/
@SpringBootApplication
public class App {
/**
* Program entry point
* Program entry point.
*
* @param args command line args
*/

View File

@ -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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
/**

View File

@ -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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
/**

View File

@ -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
@ -20,19 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* An adapter to communicate with information micro-service.
*/
@ -43,15 +42,19 @@ public class ProductInformationClientImpl implements ProductInformationClient {
@Override
public String getProductTitle() {
String response = null;
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpGet httpGet = new HttpGet("http://localhost:51515/information");
try (CloseableHttpResponse httpResponse = httpClient.execute(httpGet)) {
response = EntityUtils.toString(httpResponse.getEntity());
}
} catch (IOException e) {
LOGGER.error("Exception caught.", e);
var request = HttpRequest.newBuilder()
.GET()
.uri(URI.create("http://localhost:51515/information"))
.build();
var client = HttpClient.newHttpClient();
try {
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
return httpResponse.body();
} catch (IOException ioe) {
LOGGER.error("IOException Occurred", ioe);
} catch (InterruptedException ie) {
LOGGER.error("InterruptedException Occurred", ie);
}
return response;
return null;
}
}

View File

@ -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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
/**
@ -27,5 +28,5 @@ package com.iluwatar.aggregator.microservices;
*/
public interface ProductInventoryClient {
int getProductInventories();
Integer getProductInventories();
}

View File

@ -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
@ -20,19 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* An adapter to communicate with inventory micro-service.
*/
@ -42,16 +41,26 @@ public class ProductInventoryClientImpl implements ProductInventoryClient {
private static final Logger LOGGER = LoggerFactory.getLogger(ProductInventoryClientImpl.class);
@Override
public int getProductInventories() {
String response = "0";
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpGet httpGet = new HttpGet("http://localhost:51516/inventories");
try (CloseableHttpResponse httpResponse = httpClient.execute(httpGet)) {
response = EntityUtils.toString(httpResponse.getEntity());
}
} catch (IOException e) {
LOGGER.error("Exception caught.", e);
public Integer getProductInventories() {
var response = "";
var request = HttpRequest.newBuilder()
.GET()
.uri(URI.create("http://localhost:51516/inventories"))
.build();
var client = HttpClient.newHttpClient();
try {
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
response = httpResponse.body();
} catch (IOException ioe) {
LOGGER.error("IOException Occurred", ioe);
} catch (InterruptedException ie) {
LOGGER.error("InterruptedException Occurred", ie);
}
if ("".equalsIgnoreCase(response)) {
return null;
} else {
return Integer.parseInt(response);
}
return Integer.parseInt(response);
}
}

View File

@ -1,6 +1,6 @@
#
# 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
@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
server.port=50004

View File

@ -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
@ -20,17 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.aggregator.microservices;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
/**
* Test Aggregation of domain objects
*/
@ -55,13 +56,13 @@ public class AggregatorTest {
*/
@Test
public void testGetProduct() {
String title = "The Product Title.";
int inventories = 5;
var title = "The Product Title.";
var inventories = 5;
when(informationClient.getProductTitle()).thenReturn(title);
when(inventoryClient.getProductInventories()).thenReturn(inventories);
Product testProduct = aggregator.getProduct();
var testProduct = aggregator.getProduct();
assertEquals(title, testProduct.getTitle());
assertEquals(inventories, testProduct.getProductInventories());

View File

@ -0,0 +1,2 @@
@startuml
@enduml

View File

@ -0,0 +1,12 @@
@startuml
package com.iluwatar.information.microservice {
class InformationApplication {
+ InformationApplication()
+ main(args : String[]) {static}
}
class InformationController {
+ InformationController()
+ getProductTitle() : String
}
}
@enduml

View File

@ -1,84 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>information-microservice</artifactId>
<packaging>jar</packaging>
<artifactId>information-microservice</artifactId>
<packaging>jar</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.information.microservices.InformationApplication</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.information.microservice;
import org.springframework.boot.SpringApplication;

View File

@ -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
@ -20,6 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.information.microservice;
import org.springframework.web.bind.annotation.RequestMapping;
@ -27,7 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* Controller providing endpoints to retrieve information about products
* Controller providing endpoints to retrieve information about products.
*/
@RestController
public class InformationController {

View File

@ -1,6 +1,6 @@
#
# 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
@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
server.port=51515

View File

@ -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
@ -20,12 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.information.microservice;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
/**
* Test for Information Rest Controller
*/
@ -33,10 +34,8 @@ public class InformationControllerTest {
@Test
public void shouldGetProductTitle() {
InformationController infoController = new InformationController();
String title = infoController.getProductTitle();
var infoController = new InformationController();
var title = infoController.getProductTitle();
assertEquals("The Product Title.", title);
}

View File

@ -0,0 +1,12 @@
@startuml
package com.iluwatar.inventory.microservice {
class InventoryApplication {
+ InventoryApplication()
+ main(args : String[]) {static}
}
class InventoryController {
+ InventoryController()
+ getProductInventories() : int
}
}
@enduml

View File

@ -1,84 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
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
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- The MIT License 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: The above copyright notice and this
permission notice shall be included in all copies or substantial portions
of the Software. 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.21.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>aggregator-microservices</artifactId>
<groupId>com.iluwatar</groupId>
<version>1.23.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inventory-microservice</artifactId>
<artifactId>inventory-microservice</artifactId>
<packaging>jar</packaging>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.inventory.microservices.InventoryApplication</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

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