Prototype Use Case : Design Patterns In Python

Prototype Use Case : Design Patterns In Python

Channel:
Subscribers:
24,900
Published on ● Video Link: https://www.youtube.com/watch?v=kiMgCLXckU0



Duration: 6:23
0 views
2


Medium Article : https://medium.com/design-patterns-in-python/prototype-design-pattern-in-python-45f8d3f15583

Documentation : https://sbcode.net/python/prototype/#example-use-case

Sometimes you just want to switch off your computer and read from a book. So, all GoF patterns are discussed in my Design Patterns In Python book
https://www.amazon.com/dp/B08XLJ8Z2J : ASIN B08XLJ8Z2J

In this example, an object called document is cloned using shallow, 2 level shallow, and full recursive deep methods.

The object contains a list of two lists. Four copies are created, and each time some part of the list is changed on the clone, and depending on the method used, it can affect the original object.

When cloning an object, it is good to understand the deep versus shallow concept of copying.







Tags:
Design Patterns In Python
B08XLJ8Z2J
prototype
prototype pattern
python design patterns