Skip to content

Commit 3451c44

Browse files
committed
updates
1 parent f88e02d commit 3451c44

File tree

23 files changed

+0
-283
lines changed

23 files changed

+0
-283
lines changed

abstract_factory/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ python ./abstract_factory/abstract_factory_concept.py
4848

4949
*...Refer to Book or Videos for extra content.*
5050

51-
<!-- An example use case may be that you have a furniture shop front. You sell many different kinds of furniture. You sell chairs and tables. And they are manufactured at different factories using different unrelated processes that are not important for your concern. You only need the factory to deliver.
52-
53-
You can create an extra module called `FurnitureFactory`, to handle the chair and table factories, thus removing the implementation details from the client. -->
54-
5551
## Abstract Factory Example UML Diagram
5652

5753
See this UML diagram of an Abstract Furniture Factory implementation that returns chairs and tables.

adapter/README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ The Adapter is used when you have an existing interface that doesn't directly ma
5050

5151
*...Refer to Book or Videos for extra content.*
5252

53-
<!-- In this concept source code, there are two classes, `ClassA` and `ClassB`, with different method signatures. Let's consider that `ClassA` provides the most compatible and preferred interface for the client.
54-
55-
I can create objects of both classes in the client and it works. But before using each objects method, I need to do a conditional check to see which type of class it is that I am calling since the method signatures are different.
56-
57-
It means that the client is doing extra work. Instead, I can create an Adapter interface for the incompatible `ClassB`, that reduces the need for the extra conditional logic. -->
58-
5953
## Output
6054

6155
``` bash
@@ -70,15 +64,6 @@ method B
7064

7165
*...Refer to Book or Videos for extra content.*
7266

73-
<!-- The example client can manufacture a **Cube** using different tools. Each solution is invented by a different company.
74-
The client user interface manages the Cube product by indicating the **width**, **height** and **depth**. This is compatible with the company A that produces the Cube tool, but not the company B that produces their own version of the Cube tool that uses a different interface with different parameters.
75-
76-
In this example, the client will re-use the interface for company A's Cube and create a compatible Cube from company B.
77-
78-
An adapter will be needed so that the same method signature can be used by the client without the need to ask company B to modify their Cube tool for our specific domains use case.
79-
80-
My imaginary company needs to use both cube suppliers since there is a large demand for cubes and when one supplier is busy, I can then ask the other supplier. -->
81-
8267
## Example UML Diagram
8368

8469
![Adapter Pattern in Context](/img/adapter_example.svg)

bridge/README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ The implementer part of a Bridge, can have one or more possible implementations
6767

6868
*...Refer to Book or Videos for extra content.*
6969

70-
<!-- In the concept demonstration code, imagine that the classes were tightly coupled. The concrete class would print out some text to the console.
71-
72-
After abstracting the class along a common ground, it is now more versatile. The implementation and has been separated from the abstraction and now it can print out the same text in two different ways.
73-
74-
The befit now is that each refined abstraction and implementer can now be worked on independently without affecting the other implementations. -->
75-
7670
## Output
7771

7872
``` bash
@@ -87,16 +81,6 @@ c
8781

8882
*...Refer to Book or Videos for extra content.*
8983

90-
<!-- In this example, I draw a square and a circle. Both of these can be categorized as shapes.
91-
92-
The shape is set up as the abstraction interface. The refined abstractions, `Square` and `Circle` , implement the `IShape` interface.
93-
94-
When the Square and Circle objects are created, they are also assigned their appropriate implementers being `SquareImplementer` and `CircleImplementer` .
95-
96-
When each shape's `draw` method is called, the equivalent method within their implementer is called.
97-
98-
The Square and Circle are bridged and each implementer and abstraction can be worked on independently. -->
99-
10084
## Example UML Diagram
10185

10286
![Bridge Pattern in Context](/img/bridge_example.svg)

builder/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ The Builder and Factory patterns are very similar in the fact they both instanti
4040

4141
*...Refer to Book or Videos for extra content.*
4242

43-
<!-- 1. Client creates the **Director**.
44-
2. The Client calls the Directors `construct()` method that manages each step of the build process.
45-
3. The Director returns the product to the client or alternatively could also provide a method for the client to retrieve it later. -->
46-
4743
## Output
4844

4945
``` bash
@@ -55,14 +51,6 @@ python ./builder/builder_concept.py
5551

5652
*...Refer to Book or Videos for extra content.*
5753

58-
<!-- Using the Builder Pattern in the context of a House Builder.
59-
60-
There are multiple directors that can create their own complex objects.
61-
62-
Note that in the `IglooDirector` class, not all of the methods of the `HouseBuilder` were called.
63-
64-
The builder can construct complex objects in any order and include/exclude whichever parts it likes. -->
65-
6654
## Example UML Diagram
6755

6856
![Builder Pattern in Context](/img/builder_example.svg)

chain_of_responsibility/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ The chain that the object will pass through is normally dynamic at runtime, alth
4141

4242
*...Refer to Book or Videos for extra content.*
4343

44-
<!-- In this concept code, a chain is created with a default first successor. A number is passed to a successor, which then does a random test, and depending on the result will modify the number and then pass it onto the next successor. The process is randomized and will end at some point when there are no more successors designated. -->
45-
4644
## Output
4745

4846
``` bash
@@ -61,13 +59,6 @@ Finished result = -1.5
6159

6260
*...Refer to Book or Videos for extra content.*
6361

64-
<!--
65-
In the ATM example below, the chain is hard coded in the client first to dispense amounts of £50s, then £20s and then £10s in order.
66-
67-
This default chain order helps to ensure that the minimum number of notes will be dispensed. Otherwise, it might dispense 5 x £10 when it would have been better to dispense 1 x £50.
68-
69-
Each successor may be re-called recursively for each denomination depending on the value that was requested for withdrawal. -->
70-
7162
## Example UML Diagram
7263

7364
![Chain of Responsibility Design Pattern](/img/chain_of_responsibility_example.svg)

command/README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ Uses:
5353

5454
*...Refer to Book or Videos for extra content.*
5555

56-
<!-- The Client instantiates a Receiver that accepts certain commands.
57-
58-
The Client then creates two Command objects that will call one of the specific commands on the Receiver.
59-
60-
The Client then creates an Invoker, E.g., a user interface with buttons, and registers both Commands into the Invokers dictionary of commands.
61-
62-
The Client doesn't call the receivers commands directly, but the via the Invoker, which then calls the registered Command objects `execute()` method.
63-
64-
This abstraction between the invoker, command and receiver, allows the Invoker to add extra functionality such as history, replay, UNDO/REDO, logging, alerting and any other useful things that may be required. -->
65-
6656
## Output
6757

6858
``` bash
@@ -77,14 +67,6 @@ Executing Command 2
7767

7868
*...Refer to Book or Videos for extra content.*
7969

80-
<!-- This will be a smart light switch.
81-
82-
This light switch will keep a history of each time one of its commands was called.
83-
84-
And it can replay its commands.
85-
86-
A smart light switch could be extended in the future to be called remotely or automated depending on sensors. -->
87-
8870
## Example UML Diagram
8971

9072
![The Command Pattern UML Diagram](/img/command_example.svg)

composite/README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ Examples of using the Composite Design Pattern can be seen in a file
4242

4343
*...Refer to Book or Videos for extra content.*
4444

45-
<!-- In this concept code, two leaves are created, `LEAF_A` and `LEAF_B`, and two composites are created, `COMPOSITE_1` and `COMPOSITE_2` .
46-
47-
`LEAF_A` is attached to `COMPOSITE_1` .
48-
49-
Then I change my mind and attach `LEAF_A` to `COMPOSITE_2` .
50-
51-
I then attach `COMPOSITE_1` to `COMPOSITE_2` .
52-
53-
`LEAF_B` is not attached to composites. -->
54-
5545
## Output
5646

5747
``` bash
@@ -72,14 +62,6 @@ COMPOSITE_2 id:2050574298128
7262

7363
*...Refer to Book or Videos for extra content.*
7464

75-
<!-- Demonstration of a simple in memory hierarchal file system.
76-
77-
A root object is created that is a composite.
78-
79-
Several files (leaves) are created and added to the root folder.
80-
81-
More folders (composites) are created, and more files are added, and then the hierarchy is reordered. -->
82-
8365
## Composite Example UML Diagram
8466

8567
![Composite Pattern Use Case UML Diagram](/img/composite_example.svg)

decorator/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ Decorator Method(Component Method)
5151

5252
*...Refer to Book or Videos for extra content.*
5353

54-
<!-- Let's create a custom class called `Value` that will hold a number.
55-
56-
Then add decorators that allow addition (`Add`) and subtraction (`Sub`) to a number (`Value`).
57-
58-
The `Add` and `Sub` decorators can accept integers directly, a custom `Value` object or other `Add` and `Sub` decorators.
59-
60-
`Add`, `Sub` and `Value` all implement the `IValue` interface and can be used recursively. -->
61-
6254
## Example UML Diagram
6355

6456
![Decorator Pattern in Context](/img/decorator_example.svg)

facade/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ B
4343

4444
*...Refer to Book or Videos for extra content.*
4545

46-
<!-- This is an example of a game engine API. The facade layer is creating one streamlined interface consisting of several methods from several larger API backend systems.
47-
48-
The client could connect directly to each subsystems API and implement its authentication protocols, specific methods, etc. While it is possible, it would be quite a lot of consideration for each of the development teams, so the facade API unifies the common methods which becomes much less overwhelming for each new the client developer to integrate into. -->
49-
5046
## Example UML Diagram
5147

5248
![Facade Example UML Diagram](/img/facade_example.svg)

factory/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ The Factory pattern is really about adding that extra abstraction between the ob
5050

5151
*...Refer to Book or Videos for extra content.*
5252

53-
<!-- In this concept example, the client wants an object named `b`
54-
55-
Rather than creating `b` directly in the client, it asks the creator (factory) for the object instead.
56-
57-
The factory finds the relevant class using some kind of logic from the attributes of the request. It then asks the subclass to instantiate the new object which it then returns as a reference back to the client asking for it. -->
58-
5953
## Output
6054

6155
``` bash
@@ -67,12 +61,6 @@ ConcreteProductB
6761

6862
*...Refer to Book or Videos for extra content.*
6963

70-
<!-- An example use case is a user interface where the user can select from a menu of items, such as chairs.
71-
72-
The user has been given a choice using some kind of navigation interface, and it is unknown what choice, or how many the user will make until the application is actually running and the user starts using it.
73-
74-
So, when the user selected the chair, the factory then takes some property involved with that selection, such as an ID, Type or other attribute and then decides which relevant subclass to instantiate in order to return the appropriate object. -->
75-
7664
## Factory Example UML Diagram
7765

7866
![Chair Factory](/img/factory_example.svg)

0 commit comments

Comments
 (0)