diff --git a/Behavioral/ChainOfResponsibilities/uml/ChainOfResponsibilities.uml b/Behavioral/ChainOfResponsibilities/uml/ChainOfResponsibilities.uml new file mode 100644 index 0000000..3b79650 --- /dev/null +++ b/Behavioral/ChainOfResponsibilities/uml/ChainOfResponsibilities.uml @@ -0,0 +1,36 @@ + + + PHP + \DesignPatterns\Behavioral\ChainOfResponsibilities\Handler + + \DesignPatterns\Behavioral\ChainOfResponsibilities\Handler + \DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\SlowStorage + \DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\FastStorage + \DesignPatterns\Behavioral\ChainOfResponsibilities\Request + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/ChainOfResponsibilities/uml/uml.png b/Behavioral/ChainOfResponsibilities/uml/uml.png new file mode 100644 index 0000000..de55fd2 Binary files /dev/null and b/Behavioral/ChainOfResponsibilities/uml/uml.png differ diff --git a/Behavioral/ChainOfResponsibilities/uml/uml.svg b/Behavioral/ChainOfResponsibilities/uml/uml.svg new file mode 100644 index 0000000..38dd1af --- /dev/null +++ b/Behavioral/ChainOfResponsibilities/uml/uml.svg @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + successor + + + + + + + + + + + + append(handler) + + + + + + + + + handle(req) + + + + + + + + + processing(req) + + + + + + + + + + + + + Handler + + + Handler + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + + + __construct(data) + + + + + + + + + + + + processing(req) + + + + + + + + + + + + + FastStorage + + + FastStorage + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + + + __construct(data) + + + + + + + + + + + + processing(req) + + + + + + + + + + + + + SlowStorage + + + SlowStorage + + + + + + + + + + + + + + + + Request + + + Request + + + + + + + + + + + diff --git a/Behavioral/Command/uml/Command.uml b/Behavioral/Command/uml/Command.uml new file mode 100644 index 0000000..368d5f0 --- /dev/null +++ b/Behavioral/Command/uml/Command.uml @@ -0,0 +1,28 @@ + + + PHP + \DesignPatterns\Behavioral\Command\HelloCommand + + \DesignPatterns\Behavioral\Command\Invoker + \DesignPatterns\Behavioral\Command\HelloCommand + \DesignPatterns\Behavioral\Command\Receiver + \DesignPatterns\Behavioral\Command\CommandInterface + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Command/uml/uml.png b/Behavioral/Command/uml/uml.png new file mode 100644 index 0000000..d021750 Binary files /dev/null and b/Behavioral/Command/uml/uml.png differ diff --git a/Behavioral/Command/uml/uml.svg b/Behavioral/Command/uml/uml.svg new file mode 100644 index 0000000..94e72d0 --- /dev/null +++ b/Behavioral/Command/uml/uml.svg @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + command + + + + + + + + + + + + setCommand(cmd) + + + + + + + + + run() + + + + + + + + + + + + + Invoker + + + Invoker + + + + + + + + + + + + + + + + + + + output + + + + + + + + + + + + __construct(console) + + + + + + + + + + + + execute() + + + + + + + + + + + + + HelloCommand + + + HelloCommand + + + + + + + + + + + + + + + + + + execute() + + + + + + + + + + + + + CommandInterface + + + CommandInterface + + + + + + + + + + + + + + + + + + write(str) + + + + + + + + + + + + + Receiver + + + Receiver + + + + + + + + + diff --git a/Behavioral/Iterator/uml/Iterator.uml b/Behavioral/Iterator/uml/Iterator.uml new file mode 100644 index 0000000..752fc1b --- /dev/null +++ b/Behavioral/Iterator/uml/Iterator.uml @@ -0,0 +1,28 @@ + + + PHP + \DesignPatterns\Behavioral\Iterator\Book + + \DesignPatterns\Behavioral\Iterator\BookListReverseIterator + \DesignPatterns\Behavioral\Iterator\BookList + \DesignPatterns\Behavioral\Iterator\BookListIterator + \DesignPatterns\Behavioral\Iterator\Book + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Iterator/uml/uml.png b/Behavioral/Iterator/uml/uml.png new file mode 100644 index 0000000..6022630 Binary files /dev/null and b/Behavioral/Iterator/uml/uml.png differ diff --git a/Behavioral/Iterator/uml/uml.svg b/Behavioral/Iterator/uml/uml.svg new file mode 100644 index 0000000..d72d5b8 --- /dev/null +++ b/Behavioral/Iterator/uml/uml.svg @@ -0,0 +1,638 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bookList + + + + + + + + + + currentBook + + + + + + + + + + + + __construct(bookList) + + + + + + + + + + + + next() + + + + + + + + + valid() + + + + + + + + + + + + + BookListReverseIterator + + + BookListReverseIterator + + + + + + + + + + + + + + + + + + + + + + + + + books + + + + + + + + + + + + getBook(bookNumberToGet) + + + + + + + + + addBook(book) + + + + + + + + + removeBook(bookToRemove) + + + + + + + + + count() + + + + + + + + + + + + + BookList + + + BookList + + + + + + + + + + + + + + + + + + + bookList + + + + + + + + + + currentBook + + + + + + + + + + + + __construct(bookList) + + + + + + + + + + + + current() + + + + + + + + + next() + + + + + + + + + key() + + + + + + + + + valid() + + + + + + + + + rewind() + + + + + + + + + + + + + BookListIterator + + + BookListIterator + + + + + + + + + + + + + + + + + + + author + + + + + + + + + + title + + + + + + + + + + + + __construct(title, author) + + + + + + + + + + + + getAuthor() + + + + + + + + + getTitle() + + + + + + + + + getAuthorAndTitle() + + + + + + + + + + + + + Book + + + Book + + + + + + + + + diff --git a/Behavioral/Mediator/uml/Mediator.uml b/Behavioral/Mediator/uml/Mediator.uml new file mode 100644 index 0000000..19df84e --- /dev/null +++ b/Behavioral/Mediator/uml/Mediator.uml @@ -0,0 +1,46 @@ + + + PHP + \DesignPatterns\Behavioral\Mediator\Colleague + + \DesignPatterns\Behavioral\Mediator\Subsystem\Database + \DesignPatterns\Behavioral\Mediator\MediatorInterface + \DesignPatterns\Behavioral\Mediator\Subsystem\Client + \DesignPatterns\Behavioral\Mediator\Mediator + \DesignPatterns\Behavioral\Mediator\Subsystem\Server + \DesignPatterns\Behavioral\Mediator\Colleague + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Mediator/uml/uml.png b/Behavioral/Mediator/uml/uml.png new file mode 100644 index 0000000..04efc46 Binary files /dev/null and b/Behavioral/Mediator/uml/uml.png differ diff --git a/Behavioral/Mediator/uml/uml.svg b/Behavioral/Mediator/uml/uml.svg new file mode 100644 index 0000000..6934436 --- /dev/null +++ b/Behavioral/Mediator/uml/uml.svg @@ -0,0 +1,651 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getData() + + + + + + + + + + + + + Database + + + Database + + + + + + + + + + + + + + + + + + + + + + + + sendResponse(content) + + + + + + + + + makeRequest() + + + + + + + + + queryDb() + + + + + + + + + + + + + MediatorInterface + + + MediatorInterface + + + + + + + + + + + + + + + + + + request() + + + + + + + + + output(content) + + + + + + + + + + + + + Client + + + Client + + + + + + + + + + + + + + + + + + + + + + + + + server + + + + + + + + + + database + + + + + + + + + + client + + + + + + + + + + + + setColleague(db, cl, srv) + + + + + + + + + makeRequest() + + + + + + + + + queryDb() + + + + + + + + + sendResponse(content) + + + + + + + + + + + + + Mediator + + + Mediator + + + + + + + + + + + + + + + + + + + + + process() + + + + + + + + + + + + + Server + + + Server + + + + + + + + + + + + + + + + + + + + + + + + + mediator + + + + + + + + + + + + __construct(medium) + + + + + + + + + + + + getMediator() + + + + + + + + + + + + + Colleague + + + Colleague + + + + + + + + + + + + + + + diff --git a/Behavioral/Memento/uml/Momento.uml b/Behavioral/Memento/uml/Momento.uml new file mode 100644 index 0000000..c72667e --- /dev/null +++ b/Behavioral/Memento/uml/Momento.uml @@ -0,0 +1,22 @@ + + + PHP + \DesignPatterns\Behavioral\Memento\Caretaker + + \DesignPatterns\Behavioral\Memento\Caretaker + \DesignPatterns\Behavioral\Memento\Originator + \DesignPatterns\Behavioral\Memento\Memento + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Memento/uml/uml.png b/Behavioral/Memento/uml/uml.png new file mode 100644 index 0000000..e96ea69 Binary files /dev/null and b/Behavioral/Memento/uml/uml.png differ diff --git a/Behavioral/Memento/uml/uml.svg b/Behavioral/Memento/uml/uml.svg new file mode 100644 index 0000000..2cc47a8 --- /dev/null +++ b/Behavioral/Memento/uml/uml.svg @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + state + + + + + + + + + + + + setState(state) + + + + + + + + + saveToMemento() + + + + + + + + + restoreFromMemento(memento) + + + + + + + + + + + + + Originator + + + Originator + + + + + + + + + + + + + + + + + + run() + + + + + + + + + + + + + Caretaker + + + Caretaker + + + + + + + + + + + + + + + + + + + state + + + + + + + + + + + + __construct(stateToSave) + + + + + + + + + + + + getState() + + + + + + + + + + + + + Memento + + + Memento + + + diff --git a/Behavioral/NullObject/uml/NullObject.uml b/Behavioral/NullObject/uml/NullObject.uml new file mode 100644 index 0000000..257c915 --- /dev/null +++ b/Behavioral/NullObject/uml/NullObject.uml @@ -0,0 +1,36 @@ + + + PHP + \DesignPatterns\Behavioral\NullObject\Service + + \DesignPatterns\Behavioral\NullObject\NullLogger + \DesignPatterns\Behavioral\NullObject\PrintLogger + \DesignPatterns\Behavioral\NullObject\LoggerInterface + \DesignPatterns\Behavioral\NullObject\Service + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/NullObject/uml/uml.png b/Behavioral/NullObject/uml/uml.png new file mode 100644 index 0000000..9a081be Binary files /dev/null and b/Behavioral/NullObject/uml/uml.png differ diff --git a/Behavioral/NullObject/uml/uml.svg b/Behavioral/NullObject/uml/uml.svg new file mode 100644 index 0000000..12273b4 --- /dev/null +++ b/Behavioral/NullObject/uml/uml.svg @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + log(str) + + + + + + + + + + + + + NullLogger + + + NullLogger + + + + + + + + + + + + + + + + + + log(str) + + + + + + + + + + + + + PrintLogger + + + PrintLogger + + + + + + + + + + + + + + + + + + log(str) + + + + + + + + + + + + + LoggerInterface + + + LoggerInterface + + + + + + + + + + + + + + + + + + + logger + + + + + + + + + + + + __construct(log) + + + + + + + + + + + + doSomething() + + + + + + + + + + + + + Service + + + Service + + + + + + + + + + + diff --git a/Behavioral/Observer/uml/Observer.uml b/Behavioral/Observer/uml/Observer.uml new file mode 100644 index 0000000..0e5ddef --- /dev/null +++ b/Behavioral/Observer/uml/Observer.uml @@ -0,0 +1,27 @@ + + + PHP + \DesignPatterns\Behavioral\Observer\User + + \DesignPatterns\Behavioral\Observer\UserObserver + \DesignPatterns\Behavioral\Observer\User + \SplSubject + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Observer/uml/uml.png b/Behavioral/Observer/uml/uml.png new file mode 100644 index 0000000..0300bd4 Binary files /dev/null and b/Behavioral/Observer/uml/uml.png differ diff --git a/Behavioral/Observer/uml/uml.svg b/Behavioral/Observer/uml/uml.svg new file mode 100644 index 0000000..09c79c1 --- /dev/null +++ b/Behavioral/Observer/uml/uml.svg @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + data + + + + + + + + + + observers + + + + + + + + + + + + attach(observer) + + + + + + + + + detach(observer) + + + + + + + + + notify() + + + + + + + + + __set(name, value) + + + + + + + + + + + + + User + + + User + + + + + + + + + + + + + + + + + + update(subject) + + + + + + + + + + + + + UserObserver + + + UserObserver + + + + + + + + + + + + + + + + + + attach(observer) + + + + + + + + + detach(observer) + + + + + + + + + notify() + + + + + + + + + + + + + SplSubject + + + SplSubject + + + + + + + + + diff --git a/Behavioral/Specification/uml/Specification.uml b/Behavioral/Specification/uml/Specification.uml new file mode 100644 index 0000000..003e549 --- /dev/null +++ b/Behavioral/Specification/uml/Specification.uml @@ -0,0 +1,55 @@ + + + PHP + \DesignPatterns\Behavioral\Specification\AbstractSpecification + + \DesignPatterns\Behavioral\Specification\PriceSpecification + \DesignPatterns\Behavioral\Specification\Not + \DesignPatterns\Behavioral\Specification\SpecificationInterface + \DesignPatterns\Behavioral\Specification\Plus + \DesignPatterns\Behavioral\Specification\AbstractSpecification + \DesignPatterns\Behavioral\Specification\Either + \DesignPatterns\Behavioral\Specification\Item + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Specification/uml/uml.png b/Behavioral/Specification/uml/uml.png new file mode 100644 index 0000000..0b31e49 Binary files /dev/null and b/Behavioral/Specification/uml/uml.png differ diff --git a/Behavioral/Specification/uml/uml.svg b/Behavioral/Specification/uml/uml.svg new file mode 100644 index 0000000..cfab544 --- /dev/null +++ b/Behavioral/Specification/uml/uml.svg @@ -0,0 +1,761 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + maxPrice + + + + + + + + + + minPrice + + + + + + + + + + + + setMaxPrice(maxPrice) + + + + + + + + + setMinPrice(minPrice) + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + + + + + PriceSpecification + + + PriceSpecification + + + + + + + + + + + + + + + + + + + spec + + + + + + + + + + + + __construct(spec) + + + + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + + + + + Not + + + Not + + + + + + + + + + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + plus(spec) + + + + + + + + + either(spec) + + + + + + + + + not() + + + + + + + + + + + + + SpecificationInterface + + + SpecificationInterface + + + + + + + + + + + + + + + + + + + left + + + + + + + + + + right + + + + + + + + + + + + __construct(left, right) + + + + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + + + + + Plus + + + Plus + + + + + + + + + + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + plus(spec) + + + + + + + + + either(spec) + + + + + + + + + not() + + + + + + + + + + + + + AbstractSpecification + + + AbstractSpecification + + + + + + + + + + + + + + + + + + + left + + + + + + + + + + right + + + + + + + + + + + + __construct(left, right) + + + + + + + + + + + + isSatisfiedBy(item) + + + + + + + + + + + + + Either + + + Either + + + + + + + + + + + + + + + + + + + price + + + + + + + + + + + + __construct(price) + + + + + + + + + + + + getPrice() + + + + + + + + + + + + + Item + + + Item + + + + + + + + + + + + + + + + + diff --git a/Behavioral/State/uml/State.uml b/Behavioral/State/uml/State.uml new file mode 100644 index 0000000..6b825dd --- /dev/null +++ b/Behavioral/State/uml/State.uml @@ -0,0 +1,37 @@ + + + PHP + \DesignPatterns\Behavioral\State\OrderInterface + + \DesignPatterns\Behavioral\State\OrderFactory + \DesignPatterns\Behavioral\State\CreateOrder + \DesignPatterns\Behavioral\State\OrderController + \DesignPatterns\Behavioral\State\OrderInterface + \DesignPatterns\Behavioral\State\ShippingOrder + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/State/uml/uml.png b/Behavioral/State/uml/uml.png new file mode 100644 index 0000000..847a4e4 Binary files /dev/null and b/Behavioral/State/uml/uml.png differ diff --git a/Behavioral/State/uml/uml.svg b/Behavioral/State/uml/uml.svg new file mode 100644 index 0000000..2b97e07 --- /dev/null +++ b/Behavioral/State/uml/uml.svg @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + order + + + + + + + + + + + + __construct(order) + + + + + + + + + + + + shipOrder() + + + + + + + + + completeOrder() + + + + + + + + + + + + + CreateOrder + + + CreateOrder + + + + + + + + + + + + + + + + + + __construct() + + + + + + + + + + + + getOrder(id) + + + + + + + + + + + + + OrderFactory + + + OrderFactory + + + + + + + + + + + + + + + + + + shipAction(id) + + + + + + + + + completeAction(id) + + + + + + + + + + + + + OrderController + + + OrderController + + + + + + + + + + + + + + + + + + shipOrder() + + + + + + + + + completeOrder() + + + + + + + + + + + + + OrderInterface + + + OrderInterface + + + + + + + + + + + + + + + + + + + order + + + + + + + + + + + + __construct(order) + + + + + + + + + + + + shipOrder() + + + + + + + + + completeOrder() + + + + + + + + + + + + + ShippingOrder + + + ShippingOrder + + + + + + + + + + + diff --git a/Behavioral/Strategy/uml/Strategy.uml b/Behavioral/Strategy/uml/Strategy.uml new file mode 100644 index 0000000..7c2838a --- /dev/null +++ b/Behavioral/Strategy/uml/Strategy.uml @@ -0,0 +1,36 @@ + + + PHP + \DesignPatterns\Behavioral\Strategy\ComparatorInterface + + \DesignPatterns\Behavioral\Strategy\ObjectCollection + \DesignPatterns\Behavioral\Strategy\DateComparator + \DesignPatterns\Behavioral\Strategy\ComparatorInterface + \DesignPatterns\Behavioral\Strategy\IdComparator + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Strategy/uml/uml.png b/Behavioral/Strategy/uml/uml.png new file mode 100644 index 0000000..269e496 Binary files /dev/null and b/Behavioral/Strategy/uml/uml.png differ diff --git a/Behavioral/Strategy/uml/uml.svg b/Behavioral/Strategy/uml/uml.svg new file mode 100644 index 0000000..b441390 --- /dev/null +++ b/Behavioral/Strategy/uml/uml.svg @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + elements + + + + + + + + + + comparator + + + + + + + + + + + + __construct(elements) + + + + + + + + + + + + sort() + + + + + + + + + setComparator(comparator) + + + + + + + + + + + + + ObjectCollection + + + ObjectCollection + + + + + + + + + + + + + + + + + + compare(a, b) + + + + + + + + + + + + + DateComparator + + + DateComparator + + + + + + + + + + + + + + + + + + compare(a, b) + + + + + + + + + + + + + ComparatorInterface + + + ComparatorInterface + + + + + + + + + + + + + + + + + + compare(a, b) + + + + + + + + + + + + + IdComparator + + + IdComparator + + + + + + + + + + + diff --git a/Behavioral/TemplateMethod/uml/TemplateMethod.uml b/Behavioral/TemplateMethod/uml/TemplateMethod.uml new file mode 100644 index 0000000..063b022 --- /dev/null +++ b/Behavioral/TemplateMethod/uml/TemplateMethod.uml @@ -0,0 +1,35 @@ + + + PHP + \DesignPatterns\Behavioral\TemplateMethod\BeachJourney + + \DesignPatterns\Behavioral\TemplateMethod\CityJourney + \DesignPatterns\Behavioral\TemplateMethod\Journey + \DesignPatterns\Behavioral\TemplateMethod\BeachJourney + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/TemplateMethod/uml/uml.png b/Behavioral/TemplateMethod/uml/uml.png new file mode 100644 index 0000000..c557e8f Binary files /dev/null and b/Behavioral/TemplateMethod/uml/uml.png differ diff --git a/Behavioral/TemplateMethod/uml/uml.svg b/Behavioral/TemplateMethod/uml/uml.svg new file mode 100644 index 0000000..d06adcb --- /dev/null +++ b/Behavioral/TemplateMethod/uml/uml.svg @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enjoyVacation() + + + + + + + + + + + + + CityJourney + + + CityJourney + + + + + + + + + + + + + + + + + + takeATrip() + + + + + + + + + enjoyVacation() + + + + + + + + + buyGift() + + + + + + + + + buyAFlight() + + + + + + + + + takePlane() + + + + + + + + + + + + + Journey + + + Journey + + + + + + + + + + + + + + + + + + enjoyVacation() + + + + + + + + + + + + + BeachJourney + + + BeachJourney + + + + + + + + + + + diff --git a/Behavioral/Visitor/uml/Visitor.uml b/Behavioral/Visitor/uml/Visitor.uml new file mode 100644 index 0000000..cb03bd5 --- /dev/null +++ b/Behavioral/Visitor/uml/Visitor.uml @@ -0,0 +1,41 @@ + + + PHP + \DesignPatterns\Behavioral\Visitor\Group + + \DesignPatterns\Behavioral\Visitor\Role + \DesignPatterns\Behavioral\Visitor\RolePrintVisitor + \DesignPatterns\Behavioral\Visitor\Group + \DesignPatterns\Behavioral\Visitor\RoleVisitorInterface + \DesignPatterns\Behavioral\Visitor\User + + + + + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Behavioral/Visitor/uml/uml.png b/Behavioral/Visitor/uml/uml.png new file mode 100644 index 0000000..e2e59c0 Binary files /dev/null and b/Behavioral/Visitor/uml/uml.png differ diff --git a/Behavioral/Visitor/uml/uml.svg b/Behavioral/Visitor/uml/uml.svg new file mode 100644 index 0000000..b2a6945 --- /dev/null +++ b/Behavioral/Visitor/uml/uml.svg @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + accept(visitor) + + + + + + + + + + + + + Role + + + Role + + + + + + + + + + + + + + + + + + + + + + + + visitGroup(role) + + + + + + + + + visitUser(role) + + + + + + + + + + + + + RolePrintVisitor + + + RolePrintVisitor + + + + + + + + + + + + + + + + + + + name + + + + + + + + + + + + __construct(name) + + + + + + + + + + + + getName() + + + + + + + + + + + + + Group + + + Group + + + + + + + + + + + + + + + + + + + + + + + + visitUser(role) + + + + + + + + + visitGroup(role) + + + + + + + + + + + + + RoleVisitorInterface + + + RoleVisitorInterface + + + + + + + + + + + + + + + + + + + name + + + + + + + + + + + + __construct(name) + + + + + + + + + + + + getName() + + + + + + + + + + + + + User + + + User + + + + + + + + + + + + + diff --git a/Creational/Singleton/README.md b/Creational/Singleton/README.md index 5148762..b90fcdc 100644 --- a/Creational/Singleton/README.md +++ b/Creational/Singleton/README.md @@ -12,10 +12,6 @@ To have only one instance of this object in the application that will handle all * Logger (may also be a Multiton if there are many log files for several purposes) * Lock file for the application (there is only one in the filesystem ...) -## Diagram - - - ## UML Diagram ![Alt Singleton UML Diagram](uml/uml.png) \ No newline at end of file