Skip to content

Commit 747a814

Browse files
committed
updates
1 parent 243cf85 commit 747a814

File tree

10 files changed

+14
-23
lines changed

10 files changed

+14
-23
lines changed

decorator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Section | Video Link
66
-|-
77
Overview | <a id="ytVideoLink" href="https://youtu.be/XRCIKQD81rQ" target="_blank" title="Overview"><img src="/img/yt_btn_sm.gif" alt="Overview"/></a>
88
Example Use Case | <a id="ytVideoLink" href="https://youtu.be/8uDGo9DjHUc" target="_blank" title="Use Case"><img src="/img/yt_btn_sm.gif" alt="Use Case"/></a>
9-
\__str\__ Dunder | <a id="ytVideoLink" href="https://youtu.be/X84ZnxYGKFs" target="_blank" title="__str__ Dunder"><img src="/img/yt_btn_sm.gif" alt="__str__ Dunder"/></a>
9+
\__str\__ Dunder Method | <a id="ytVideoLink" href="https://youtu.be/X84ZnxYGKFs" target="_blank" title="__str__ Dunder Method"><img src="/img/yt_btn_sm.gif" alt="__str__ Dunder Method"/></a>
1010
getattr() Method | <a id="ytVideoLink" href="https://youtu.be/y27BD51JKU4" target="_blank" title="getattr() Method"><img src="/img/yt_btn_sm.gif" alt="getattr() Method"/></a>
1111

1212
## Book

factory/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Videos
44

5-
Section | Video Link
5+
Section | Video Links
66
-|-
7-
Overview | <a id="ytVideoLink" href="https://youtu.be/cfN1_e_Fyjw" target="_blank" title="Overview"><img src="/img/yt_btn_sm.gif" alt="Overview"/></a>
8-
Example Use Case | <a id="ytVideoLink" href="https://youtu.be/ywTF3yTAe3M" target="_blank" title="Use Case"><img src="/img/yt_btn_sm.gif" alt="Use Case"/></a>
9-
ABCMeta | <a id="ytVideoLink" href="https://youtu.be/8HMurBw18wU" target="_blank" title="ABCMeta"><img src="/img/yt_btn_sm.gif" alt="ABCMeta"/></a>
7+
Factory Overview | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/16396650/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="Factory Overview"><img src="/img/udemy_btn_sm.gif" alt="Factory Overview"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/cfN1_e_Fyjw" target="_blank" title="Factory Overview"><img src="/img/yt_btn_sm.gif" alt="Factory Overview"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="Factory Overview"><img src="/img/skillshare_btn_sm.gif" alt="Factory Overview"/></a>
8+
Factory Use Case | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/25362098/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="Factory Use Case"><img src="/img/udemy_btn_sm.gif" alt="Factory Use Case"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/ywTF3yTAe3M" target="_blank" title="Factory Use Case"><img src="/img/yt_btn_sm.gif" alt="Factory Use Case"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="Factory Use Case"><img src="/img/skillshare_btn_sm.gif" alt="Factory Use Case"/></a>
9+
**ABCMeta** Module | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/25362152/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="ABCMeta Module"><img src="/img/udemy_btn_sm.gif" alt="ABCMeta Module"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/8HMurBw18wU" target="_blank" title="ABCMeta Module"><img src="/img/yt_btn_sm.gif" alt="ABCMeta Module"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="ABCMeta Module"><img src="/img/skillshare_btn_sm.gif" alt="ABCMeta Module"/></a>
1010

1111
## Book
1212

@@ -119,12 +119,3 @@ Note that in all my code examples, the abstract classes are prefixed with a capi
119119

120120
See PEP 3119 : [https://www.python.org/dev/peps/pep-3119/](https://www.python.org/dev/peps/pep-3119/)
121121

122-
123-
## Summary
124-
125-
* The Factory Pattern is an Interface that defers the creation of the final object to a subclass.
126-
* The Factory pattern is about inserting another layer/abstraction between instantiating an object and where in your code it is actually used.
127-
* It is unknown what or how many objects will need to be created until runtime.
128-
* You want to localize knowledge of the specifics of instantiating a particular object to the subclass so that the client doesn't need to be concerned about the details.
129-
* You want to create an external framework, that an application can import/reference, and hide the details of the specifics involved in creating the final object/product.
130-
* The unique factor that defines the Factory pattern, is that your project now defers the creation of objects to the subclass that the factory had delegated it to.

img/adapter_concept.svg

Lines changed: 1 addition & 1 deletion
Loading

img/adapter_example.svg

Lines changed: 1 addition & 1 deletion
Loading

img/command_concept.svg

Lines changed: 1 addition & 1 deletion
Loading

img/command_example.svg

Lines changed: 1 addition & 1 deletion
Loading

img/interpreter_example.svg

Lines changed: 1 addition & 1 deletion
Loading

img/observer_concept.svg

Lines changed: 1 addition & 1 deletion
Loading

img/observer_example.svg

Lines changed: 1 addition & 1 deletion
Loading

observer/observer_concept.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def unsubscribe(self, observer):
3737

3838
def notify(self, *args):
3939
for observer in self._observers:
40-
observer.notify(self, *args)
40+
observer.notify(*args)
4141

4242

4343
class IObserver(metaclass=ABCMeta):
@@ -55,7 +55,7 @@ class Observer(IObserver):
5555
def __init__(self, observable):
5656
observable.subscribe(self)
5757

58-
def notify(self, observable, *args):
58+
def notify(self, *args):
5959
print(f"Observer id:{id(self)} received {args}")
6060

6161

0 commit comments

Comments
 (0)