From bd1b65276e899af44d84bcfe0e94a3ce57d2fc10 Mon Sep 17 00:00:00 2001 From: slawiko Date: Sun, 20 Mar 2016 11:50:21 +0300 Subject: [PATCH 1/2] all index.md files renamed to README.md for more compatibility with github --- abstract-factory/{index.md => README.md} | 0 adapter/{index.md => README.md} | 0 .../{index.md => README.md} | 0 bridge/{index.md => README.md} | 0 builder/{index.md => README.md} | 0 business-delegate/{index.md => README.md} | 0 caching/{index.md => README.md} | 0 callback/{index.md => README.md} | 0 chain/{index.md => README.md} | 0 command/{index.md => README.md} | 0 composite/{index.md => README.md} | 0 dao/{index.md => README.md} | 0 decorator/{index.md => README.md} | 0 delegation/{index.md => README.md} | 0 dependency-injection/{index.md => README.md} | 0 .../{index.md => README.md} | 0 double-dispatch/{index.md => README.md} | 0 event-aggregator/{index.md => README.md} | 0 .../{index.md => README.md} | 0 execute-around/{index.md => README.md} | 0 facade/{index.md => README.md} | 0 factory-kit/{index.md => README.md} | 0 factory-method/{index.md => README.md} | 0 feature-toggle/{index.md => README.md} | 0 fluentinterface/{index.md => README.md} | 0 flux/{index.md => README.md} | 0 flyweight/{index.md => README.md} | 0 front-controller/{index.md => README.md} | 0 half-sync-half-async/{index.md => README.md} | 0 intercepting-filter/{index.md => README.md} | 0 interpreter/{index.md => README.md} | 0 iterator/{index.md => README.md} | 0 layers/{index.md => README.md} | 0 lazy-loading/{index.md => README.md} | 0 mediator/{index.md => README.md} | 0 memento/{index.md => README.md} | 0 message-channel/{index.md => README.md} | 0 model-view-controller/{index.md => README.md} | 0 model-view-presenter/{index.md => README.md} | 0 monad/{index.md => README.md} | 68 +++++++++---------- monostate/{index.md => README.md} | 0 multiton/{index.md => README.md} | 0 naked-objects/{index.md => README.md} | 0 null-object/{index.md => README.md} | 0 object-pool/{index.md => README.md} | 0 observer/{index.md => README.md} | 0 poison-pill/{index.md => README.md} | 0 private-class-data/{index.md => README.md} | 0 producer-consumer/{index.md => README.md} | 0 property/{index.md => README.md} | 0 prototype/{index.md => README.md} | 0 proxy/{index.md => README.md} | 0 publish-subscribe/{index.md => README.md} | 0 reactor/{index.md => README.md} | 0 reader-writer-lock/{index.md => README.md} | 0 repository/{index.md => README.md} | 0 .../{index.md => README.md} | 0 servant/{index.md => README.md} | 0 service-layer/{index.md => README.md} | 0 service-locator/{index.md => README.md} | 0 singleton/{index.md => README.md} | 0 specification/{index.md => README.md} | 0 state/{index.md => README.md} | 0 step-builder/{index.md => README.md} | 0 strategy/{index.md => README.md} | 0 template-method/{index.md => README.md} | 0 thread-pool/{index.md => README.md} | 0 tolerant-reader/{index.md => README.md} | 0 twin/{index.md => README.md} | 0 value-object/{index.md => README.md} | 0 visitor/{index.md => README.md} | 0 71 files changed, 34 insertions(+), 34 deletions(-) rename abstract-factory/{index.md => README.md} (100%) rename adapter/{index.md => README.md} (100%) rename async-method-invocation/{index.md => README.md} (100%) rename bridge/{index.md => README.md} (100%) rename builder/{index.md => README.md} (100%) rename business-delegate/{index.md => README.md} (100%) rename caching/{index.md => README.md} (100%) rename callback/{index.md => README.md} (100%) rename chain/{index.md => README.md} (100%) rename command/{index.md => README.md} (100%) rename composite/{index.md => README.md} (100%) rename dao/{index.md => README.md} (100%) rename decorator/{index.md => README.md} (100%) rename delegation/{index.md => README.md} (100%) rename dependency-injection/{index.md => README.md} (100%) rename double-checked-locking/{index.md => README.md} (100%) rename double-dispatch/{index.md => README.md} (100%) rename event-aggregator/{index.md => README.md} (100%) rename event-driven-architecture/{index.md => README.md} (100%) rename execute-around/{index.md => README.md} (100%) rename facade/{index.md => README.md} (100%) rename factory-kit/{index.md => README.md} (100%) rename factory-method/{index.md => README.md} (100%) rename feature-toggle/{index.md => README.md} (100%) rename fluentinterface/{index.md => README.md} (100%) rename flux/{index.md => README.md} (100%) rename flyweight/{index.md => README.md} (100%) rename front-controller/{index.md => README.md} (100%) rename half-sync-half-async/{index.md => README.md} (100%) rename intercepting-filter/{index.md => README.md} (100%) rename interpreter/{index.md => README.md} (100%) rename iterator/{index.md => README.md} (100%) rename layers/{index.md => README.md} (100%) rename lazy-loading/{index.md => README.md} (100%) rename mediator/{index.md => README.md} (100%) rename memento/{index.md => README.md} (100%) rename message-channel/{index.md => README.md} (100%) rename model-view-controller/{index.md => README.md} (100%) rename model-view-presenter/{index.md => README.md} (100%) rename monad/{index.md => README.md} (97%) rename monostate/{index.md => README.md} (100%) rename multiton/{index.md => README.md} (100%) rename naked-objects/{index.md => README.md} (100%) rename null-object/{index.md => README.md} (100%) rename object-pool/{index.md => README.md} (100%) rename observer/{index.md => README.md} (100%) rename poison-pill/{index.md => README.md} (100%) rename private-class-data/{index.md => README.md} (100%) rename producer-consumer/{index.md => README.md} (100%) rename property/{index.md => README.md} (100%) rename prototype/{index.md => README.md} (100%) rename proxy/{index.md => README.md} (100%) rename publish-subscribe/{index.md => README.md} (100%) rename reactor/{index.md => README.md} (100%) rename reader-writer-lock/{index.md => README.md} (100%) rename repository/{index.md => README.md} (100%) rename resource-acquisition-is-initialization/{index.md => README.md} (100%) rename servant/{index.md => README.md} (100%) rename service-layer/{index.md => README.md} (100%) rename service-locator/{index.md => README.md} (100%) rename singleton/{index.md => README.md} (100%) rename specification/{index.md => README.md} (100%) rename state/{index.md => README.md} (100%) rename step-builder/{index.md => README.md} (100%) rename strategy/{index.md => README.md} (100%) rename template-method/{index.md => README.md} (100%) rename thread-pool/{index.md => README.md} (100%) rename tolerant-reader/{index.md => README.md} (100%) rename twin/{index.md => README.md} (100%) rename value-object/{index.md => README.md} (100%) rename visitor/{index.md => README.md} (100%) diff --git a/abstract-factory/index.md b/abstract-factory/README.md similarity index 100% rename from abstract-factory/index.md rename to abstract-factory/README.md diff --git a/adapter/index.md b/adapter/README.md similarity index 100% rename from adapter/index.md rename to adapter/README.md diff --git a/async-method-invocation/index.md b/async-method-invocation/README.md similarity index 100% rename from async-method-invocation/index.md rename to async-method-invocation/README.md diff --git a/bridge/index.md b/bridge/README.md similarity index 100% rename from bridge/index.md rename to bridge/README.md diff --git a/builder/index.md b/builder/README.md similarity index 100% rename from builder/index.md rename to builder/README.md diff --git a/business-delegate/index.md b/business-delegate/README.md similarity index 100% rename from business-delegate/index.md rename to business-delegate/README.md diff --git a/caching/index.md b/caching/README.md similarity index 100% rename from caching/index.md rename to caching/README.md diff --git a/callback/index.md b/callback/README.md similarity index 100% rename from callback/index.md rename to callback/README.md diff --git a/chain/index.md b/chain/README.md similarity index 100% rename from chain/index.md rename to chain/README.md diff --git a/command/index.md b/command/README.md similarity index 100% rename from command/index.md rename to command/README.md diff --git a/composite/index.md b/composite/README.md similarity index 100% rename from composite/index.md rename to composite/README.md diff --git a/dao/index.md b/dao/README.md similarity index 100% rename from dao/index.md rename to dao/README.md diff --git a/decorator/index.md b/decorator/README.md similarity index 100% rename from decorator/index.md rename to decorator/README.md diff --git a/delegation/index.md b/delegation/README.md similarity index 100% rename from delegation/index.md rename to delegation/README.md diff --git a/dependency-injection/index.md b/dependency-injection/README.md similarity index 100% rename from dependency-injection/index.md rename to dependency-injection/README.md diff --git a/double-checked-locking/index.md b/double-checked-locking/README.md similarity index 100% rename from double-checked-locking/index.md rename to double-checked-locking/README.md diff --git a/double-dispatch/index.md b/double-dispatch/README.md similarity index 100% rename from double-dispatch/index.md rename to double-dispatch/README.md diff --git a/event-aggregator/index.md b/event-aggregator/README.md similarity index 100% rename from event-aggregator/index.md rename to event-aggregator/README.md diff --git a/event-driven-architecture/index.md b/event-driven-architecture/README.md similarity index 100% rename from event-driven-architecture/index.md rename to event-driven-architecture/README.md diff --git a/execute-around/index.md b/execute-around/README.md similarity index 100% rename from execute-around/index.md rename to execute-around/README.md diff --git a/facade/index.md b/facade/README.md similarity index 100% rename from facade/index.md rename to facade/README.md diff --git a/factory-kit/index.md b/factory-kit/README.md similarity index 100% rename from factory-kit/index.md rename to factory-kit/README.md diff --git a/factory-method/index.md b/factory-method/README.md similarity index 100% rename from factory-method/index.md rename to factory-method/README.md diff --git a/feature-toggle/index.md b/feature-toggle/README.md similarity index 100% rename from feature-toggle/index.md rename to feature-toggle/README.md diff --git a/fluentinterface/index.md b/fluentinterface/README.md similarity index 100% rename from fluentinterface/index.md rename to fluentinterface/README.md diff --git a/flux/index.md b/flux/README.md similarity index 100% rename from flux/index.md rename to flux/README.md diff --git a/flyweight/index.md b/flyweight/README.md similarity index 100% rename from flyweight/index.md rename to flyweight/README.md diff --git a/front-controller/index.md b/front-controller/README.md similarity index 100% rename from front-controller/index.md rename to front-controller/README.md diff --git a/half-sync-half-async/index.md b/half-sync-half-async/README.md similarity index 100% rename from half-sync-half-async/index.md rename to half-sync-half-async/README.md diff --git a/intercepting-filter/index.md b/intercepting-filter/README.md similarity index 100% rename from intercepting-filter/index.md rename to intercepting-filter/README.md diff --git a/interpreter/index.md b/interpreter/README.md similarity index 100% rename from interpreter/index.md rename to interpreter/README.md diff --git a/iterator/index.md b/iterator/README.md similarity index 100% rename from iterator/index.md rename to iterator/README.md diff --git a/layers/index.md b/layers/README.md similarity index 100% rename from layers/index.md rename to layers/README.md diff --git a/lazy-loading/index.md b/lazy-loading/README.md similarity index 100% rename from lazy-loading/index.md rename to lazy-loading/README.md diff --git a/mediator/index.md b/mediator/README.md similarity index 100% rename from mediator/index.md rename to mediator/README.md diff --git a/memento/index.md b/memento/README.md similarity index 100% rename from memento/index.md rename to memento/README.md diff --git a/message-channel/index.md b/message-channel/README.md similarity index 100% rename from message-channel/index.md rename to message-channel/README.md diff --git a/model-view-controller/index.md b/model-view-controller/README.md similarity index 100% rename from model-view-controller/index.md rename to model-view-controller/README.md diff --git a/model-view-presenter/index.md b/model-view-presenter/README.md similarity index 100% rename from model-view-presenter/index.md rename to model-view-presenter/README.md diff --git a/monad/index.md b/monad/README.md similarity index 97% rename from monad/index.md rename to monad/README.md index 82deba922..ffc67a354 100644 --- a/monad/index.md +++ b/monad/README.md @@ -1,35 +1,35 @@ ---- -layout: pattern -title: Monad -folder: monad -permalink: /patterns/monad/ -categories: Other -tags: - - Java - - Difficulty-Advanced - - Functional ---- - -## Intent - -Monad pattern based on monad from linear algebra represents the way of chaining operations -together step by step. Binding functions can be described as passing one's output to another's input -basing on the 'same type' contract. Formally, monad consists of a type constructor M and two -operations: -bind - that takes monadic object and a function from plain object to monadic value and returns monadic value -return - that takes plain type object and returns this object wrapped in a monadic value. - -![alt text](./etc/monad.png "Monad") - -## Applicability - -Use the Monad in any of the following situations - -* when you want to chain operations easily -* when you want to apply each function regardless of the result of any of them - -## Credits - -* [Design Pattern Reloaded by Remi Forax](https://youtu.be/-k2X7guaArU) -* [Brian Beckman: Don't fear the Monad](https://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads) +--- +layout: pattern +title: Monad +folder: monad +permalink: /patterns/monad/ +categories: Other +tags: + - Java + - Difficulty-Advanced + - Functional +--- + +## Intent + +Monad pattern based on monad from linear algebra represents the way of chaining operations +together step by step. Binding functions can be described as passing one's output to another's input +basing on the 'same type' contract. Formally, monad consists of a type constructor M and two +operations: +bind - that takes monadic object and a function from plain object to monadic value and returns monadic value +return - that takes plain type object and returns this object wrapped in a monadic value. + +![alt text](./etc/monad.png "Monad") + +## Applicability + +Use the Monad in any of the following situations + +* when you want to chain operations easily +* when you want to apply each function regardless of the result of any of them + +## Credits + +* [Design Pattern Reloaded by Remi Forax](https://youtu.be/-k2X7guaArU) +* [Brian Beckman: Don't fear the Monad](https://channel9.msdn.com/Shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads) * [Monad on Wikipedia](https://en.wikipedia.org/wiki/Monad_(functional_programming)) \ No newline at end of file diff --git a/monostate/index.md b/monostate/README.md similarity index 100% rename from monostate/index.md rename to monostate/README.md diff --git a/multiton/index.md b/multiton/README.md similarity index 100% rename from multiton/index.md rename to multiton/README.md diff --git a/naked-objects/index.md b/naked-objects/README.md similarity index 100% rename from naked-objects/index.md rename to naked-objects/README.md diff --git a/null-object/index.md b/null-object/README.md similarity index 100% rename from null-object/index.md rename to null-object/README.md diff --git a/object-pool/index.md b/object-pool/README.md similarity index 100% rename from object-pool/index.md rename to object-pool/README.md diff --git a/observer/index.md b/observer/README.md similarity index 100% rename from observer/index.md rename to observer/README.md diff --git a/poison-pill/index.md b/poison-pill/README.md similarity index 100% rename from poison-pill/index.md rename to poison-pill/README.md diff --git a/private-class-data/index.md b/private-class-data/README.md similarity index 100% rename from private-class-data/index.md rename to private-class-data/README.md diff --git a/producer-consumer/index.md b/producer-consumer/README.md similarity index 100% rename from producer-consumer/index.md rename to producer-consumer/README.md diff --git a/property/index.md b/property/README.md similarity index 100% rename from property/index.md rename to property/README.md diff --git a/prototype/index.md b/prototype/README.md similarity index 100% rename from prototype/index.md rename to prototype/README.md diff --git a/proxy/index.md b/proxy/README.md similarity index 100% rename from proxy/index.md rename to proxy/README.md diff --git a/publish-subscribe/index.md b/publish-subscribe/README.md similarity index 100% rename from publish-subscribe/index.md rename to publish-subscribe/README.md diff --git a/reactor/index.md b/reactor/README.md similarity index 100% rename from reactor/index.md rename to reactor/README.md diff --git a/reader-writer-lock/index.md b/reader-writer-lock/README.md similarity index 100% rename from reader-writer-lock/index.md rename to reader-writer-lock/README.md diff --git a/repository/index.md b/repository/README.md similarity index 100% rename from repository/index.md rename to repository/README.md diff --git a/resource-acquisition-is-initialization/index.md b/resource-acquisition-is-initialization/README.md similarity index 100% rename from resource-acquisition-is-initialization/index.md rename to resource-acquisition-is-initialization/README.md diff --git a/servant/index.md b/servant/README.md similarity index 100% rename from servant/index.md rename to servant/README.md diff --git a/service-layer/index.md b/service-layer/README.md similarity index 100% rename from service-layer/index.md rename to service-layer/README.md diff --git a/service-locator/index.md b/service-locator/README.md similarity index 100% rename from service-locator/index.md rename to service-locator/README.md diff --git a/singleton/index.md b/singleton/README.md similarity index 100% rename from singleton/index.md rename to singleton/README.md diff --git a/specification/index.md b/specification/README.md similarity index 100% rename from specification/index.md rename to specification/README.md diff --git a/state/index.md b/state/README.md similarity index 100% rename from state/index.md rename to state/README.md diff --git a/step-builder/index.md b/step-builder/README.md similarity index 100% rename from step-builder/index.md rename to step-builder/README.md diff --git a/strategy/index.md b/strategy/README.md similarity index 100% rename from strategy/index.md rename to strategy/README.md diff --git a/template-method/index.md b/template-method/README.md similarity index 100% rename from template-method/index.md rename to template-method/README.md diff --git a/thread-pool/index.md b/thread-pool/README.md similarity index 100% rename from thread-pool/index.md rename to thread-pool/README.md diff --git a/tolerant-reader/index.md b/tolerant-reader/README.md similarity index 100% rename from tolerant-reader/index.md rename to tolerant-reader/README.md diff --git a/twin/index.md b/twin/README.md similarity index 100% rename from twin/index.md rename to twin/README.md diff --git a/value-object/index.md b/value-object/README.md similarity index 100% rename from value-object/index.md rename to value-object/README.md diff --git a/visitor/index.md b/visitor/README.md similarity index 100% rename from visitor/index.md rename to visitor/README.md From 2f5a2be27a9541b894b94049e02010f6dabd5b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Fri, 25 Mar 2016 22:00:08 +0200 Subject: [PATCH 2/2] Fix missing table error --- repository/src/main/java/com/iluwatar/repository/App.java | 2 ++ repository/src/main/resources/applicationContext.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/repository/src/main/java/com/iluwatar/repository/App.java b/repository/src/main/java/com/iluwatar/repository/App.java index df24e1424..2807ae7ca 100644 --- a/repository/src/main/java/com/iluwatar/repository/App.java +++ b/repository/src/main/java/com/iluwatar/repository/App.java @@ -100,6 +100,8 @@ public class App { System.out.println(person); } + repository.deleteAll(); + context.close(); } diff --git a/repository/src/main/resources/applicationContext.xml b/repository/src/main/resources/applicationContext.xml index a3b5162da..8b4b81bb7 100644 --- a/repository/src/main/resources/applicationContext.xml +++ b/repository/src/main/resources/applicationContext.xml @@ -54,7 +54,8 @@ - + +