From 1495e91b42934f39f93426ee5661c2384cf34174 Mon Sep 17 00:00:00 2001 From: Simone Gentili Date: Sat, 1 Jun 2019 01:27:05 +0200 Subject: [PATCH] add patterns elemenents --- behavioral/chain/README.md | 6 ++++++ behavioral/mediator/README.md | 6 ++++++ behavioral/memento/README.md | 6 ++++++ behavioral/observer/README.md | 7 +++++++ concurrency/pipeline/README.md | 8 ++++++++ creational/abstract_factory/README.md | 8 ++++++++ creational/builder/README.md | 7 +++++++ creational/prototype/README.md | 6 ++++++ structural/bridge/README.md | 9 +++++++++ structural/composite/README.md | 9 +++++++++ structural/flyweight/README.md | 5 ++++- structural/proxy/README.md | 2 +- 12 files changed, 77 insertions(+), 2 deletions(-) diff --git a/behavioral/chain/README.md b/behavioral/chain/README.md index 409f670..182a3bb 100644 --- a/behavioral/chain/README.md +++ b/behavioral/chain/README.md @@ -1,5 +1,11 @@ # Chain of responsibility +## Elements + + - Handler + - RequestHandler + - Client + ## Description It consists of a source of command objects and a series of processing objects. diff --git a/behavioral/mediator/README.md b/behavioral/mediator/README.md index fab9607..bbaa694 100644 --- a/behavioral/mediator/README.md +++ b/behavioral/mediator/README.md @@ -1,5 +1,11 @@ # Behavioral » Mediator +## Elements + + - Mediator + - Concrete Mediator + - Colleague Class + ## Description It defined an object that encapsulate the manner of how a set of objects diff --git a/behavioral/memento/README.md b/behavioral/memento/README.md index e7aaf70..3db5a9b 100644 --- a/behavioral/memento/README.md +++ b/behavioral/memento/README.md @@ -1,5 +1,11 @@ # Behavioral » Memento +## Elements + + - Memento + - Originator + - Caretaker + ## Description The memento pattern provides the ability to restore an object to of its diff --git a/behavioral/observer/README.md b/behavioral/observer/README.md index 2b1badf..7602924 100644 --- a/behavioral/observer/README.md +++ b/behavioral/observer/README.md @@ -1,5 +1,12 @@ # Behavioral » Observer +## Elements + + - Observable + - ConcreteObservable + - Observer + - ConcreteObserver + ## Description This pattern uncouple an event from its possible handlers. It is useful to diff --git a/concurrency/pipeline/README.md b/concurrency/pipeline/README.md index 6d6e695..666cca1 100644 --- a/concurrency/pipeline/README.md +++ b/concurrency/pipeline/README.md @@ -1,5 +1,13 @@ # Concurrency » Pipeline +## Elements + + - Visitor + - ConcreteVisitor + - Visitable + - ConcreteVisitable + - ObjectStructure + ## Description A pipeline consists of a chain of elements arranged so that the output of each diff --git a/creational/abstract_factory/README.md b/creational/abstract_factory/README.md index 325e0bd..5c7c19f 100644 --- a/creational/abstract_factory/README.md +++ b/creational/abstract_factory/README.md @@ -1,5 +1,13 @@ # Creational » Abstract Factory +## Elements + + - AbstractFactory + - ConcreteFactory + - AbstactProduct + - Product + - Client + ## Description The difference from factory design pattern is that with this pattern it is possible to manage complex data type. diff --git a/creational/builder/README.md b/creational/builder/README.md index 40841f3..c0d72b9 100644 --- a/creational/builder/README.md +++ b/creational/builder/README.md @@ -1,5 +1,12 @@ # Creational » Builder +## Elements + + - Builder + - ConcreteBuilder + - Director + - Product + ## Description The Builder is a pattern used to build objects. Objects in go can be created with just {}. But in Go is possible to create objects composed by other objects. This is really idiomatic in go, as it doesn't support inheritance. diff --git a/creational/prototype/README.md b/creational/prototype/README.md index 3d0e5d1..2dbb0c5 100644 --- a/creational/prototype/README.md +++ b/creational/prototype/README.md @@ -1,5 +1,11 @@ # Creational » Prototype +## Elements + + - Client + - Prototype + - ConcretePrototype + ## Description With this pattern, is used an already created instance of some type to clone it and complete it with the particular needs of each context. Objects to clone are created at compilation time and can be cloned as many times it is needed at runtime. diff --git a/structural/bridge/README.md b/structural/bridge/README.md index bc4dd73..7ff6616 100644 --- a/structural/bridge/README.md +++ b/structural/bridge/README.md @@ -1,4 +1,13 @@ # Bridge +## Elements + + - Abstraction + - AbstractionImplementation + - Implementor + - ConcreteImplementor + +## Description + This design pattern is used to "decouple an abstraction from its implementation so that the two can vary independently". The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. diff --git a/structural/composite/README.md b/structural/composite/README.md index e30ffc7..bb8366d 100644 --- a/structural/composite/README.md +++ b/structural/composite/README.md @@ -1,3 +1,12 @@ # Composite +## Elements + + - Component + - Leaf + - Composite + - Client + +## Description + In software engineering, the composite pattern is a partitioning design pattern. The composite pattern describes a group of objects that is treated the same way as a single instance of the same type of object. The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly. diff --git a/structural/flyweight/README.md b/structural/flyweight/README.md index c25ac92..eb42109 100644 --- a/structural/flyweight/README.md +++ b/structural/flyweight/README.md @@ -2,7 +2,10 @@ ## Elements -*to do* + - Flyweight + - ConcreteFlyweight + - FlyweightFactoy + - Client ## Dscription diff --git a/structural/proxy/README.md b/structural/proxy/README.md index 5550770..e312f60 100644 --- a/structural/proxy/README.md +++ b/structural/proxy/README.md @@ -4,7 +4,7 @@ - Proxy - RealSubject - - Client + - Subject ## Description