Skip to content

Commit 7c267c8

Browse files
committed
updated readme files for al patterns with pattern expanation
1 parent d8af1fd commit 7c267c8

File tree

15 files changed

+65
-1
lines changed

15 files changed

+65
-1
lines changed

AdapterPattern/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Adapter Pattern
22

3+
The adapter pattern converts the interface of a class into an other interface that clients expect.
4+
Useful when slowly deprecating class/methods
5+
6+
The pattern we want to maintain:
7+
Itarget target = new Adapter(new Adaptee());
8+
target. request();
9+
310
## UML diagram:
411

512
![Alt text](AdapterPatternUML.jpg?raw=true "Pattern's UML diagram")

BridgePattern/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Bridge Pattern
22

3+
The intent of the bridge pattern is to decouple an abstraction from
4+
its implementation so that the two can vary independantly.
5+
6+
Builds 2 polimorphic hirarcies.
7+
Prevents creation of all implementor-abstraction claas options.
8+
39
## UML diagram:
410

511
![Alt text](BridgeUML.jpg?raw=true "Pattern's UML diagram")

CommandPattern/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Command Pattern
22

3+
Encapsulates a request as an object thereby letting you parameterize other
4+
objects with different requests, queue/log requests, and support undo-able operations.
5+
Useful when putting commands in a queue for instance/ building macros/ making a programmable remote control..
6+
37
## UML diagram:
48

59
![Alt text](CommandUML.jpg?raw=true "Pattern's UML diagram")

CompositePattern/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Composite Pattern
22

3+
The composite pattern composes objects into tree structures to represent part-whole hirarcies.
4+
Lets clients treat individual objects and composition objects, uniformaly.
5+
36
## UML diagram:
47

58
![Alt text](CompositeUML.jpg?raw=true "Pattern's UML diagram")

Decorator_Pattern/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Decorator Pattern
22

3+
Attaches additional responsibility to an object, dynamically.
4+
Example - coffee+toppings (addons) price calculation.
5+
36
## UML diagram:
47

58
![Alt text](DecoratorUML.jpg?raw=true "Pattern's UML diagram")

FacadePattern/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Facade Pattern
22

3+
The facade pattern provides a unified interface to a set of interfaces in a sub-system.
4+
Facade defines a higher-level interface that makes the sub-system easier to use.
35
## UML diagram:
46

57
![Alt text](FacadeUML.jpg?raw=true "Pattern's UML diagram")

Factory_Pattern/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Factory Pattern
22

3+
Defines an interface to creating objects but lets the subclasses decide which object to create.
4+
35
## UML diagram:
46

57
![Alt text](FactoryUML.png?raw=true "Pattern's UML diagram")

IteratorPattern/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Iterator Pattern
22

3+
Allows to iterate over a data structure sequencially, without knowing how the data structure is implemented.
4+
35
## UML diagram:
46

57
![Alt text](IteratorUML.png?raw=true "Pattern's UML diagram")

NullObjectPattern/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Null Object Pattern
22

3+
Replacing conditionals (if obj == null {...} else {...}) with polymorpism.
4+
Replaces a null with a null-object to avoid if statements.
5+
Also can represent a null-behaviour (for instance when collecting a power-up in a game,
6+
that doesn't allow the player to move for x number of seconds).
7+
38
## UML diagram:
49

510
![Alt text](NullObjectUML.png?raw=true "Pattern's UML diagram")

Observer_Pattern/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Observer Pattern
22

3+
Tranfers control from a poll-push architecture, to a push-pull architecture, making the code event-driven.
4+
RxJava, the reactive java programming library (event driven programming), makes use of the Observer Pattern.
5+
36
## UML diagram:
47

58
![Alt text](ObserverUML.png?raw=true "Pattern's UML diagram")

0 commit comments

Comments
 (0)