diff --git a/Intro_to_Solid.md b/Intro_to_Solid.md index adc6da5..32c79c5 100644 --- a/Intro_to_Solid.md +++ b/Intro_to_Solid.md @@ -144,7 +144,7 @@ class InvoicePersistence(abc.ABC): The new _InvoicePersistence_ class has an abstract method. So, if a class inherits the _InvoicePersistence_ class, you have to implement the _save_ method. -And for example, we will create a _DataBasePersistence_ class, and this class inherit the abstract _InvoicePersistence_ class. +And for example, we will create a _DataBasePersistence_ class, and this class inherits the abstract _InvoicePersistence_ class. ```python class DatabasePersistence(InvoicePersistence): def __init__(self, invoice): @@ -154,7 +154,7 @@ class DatabasePersistence(InvoicePersistence): def save(self, invoice): print("Save in database ...") ``` -Let's make the same thing with _FilePersistence_ class. +Let's do the same thing with _FilePersistence_ class. ```python class FilePersistence(InvoicePersistence): def __init__(self, invoice): @@ -164,3 +164,13 @@ class FilePersistence(InvoicePersistence): def save(self, invoice): print("Save to file ...") ``` +Ok, we do a lot of things, let's make a UML to represent our class structure. + +
+ +
+ +That will be more simple to do extension. + +### Liskov Substitution Principle + diff --git a/assets/UML_Solid b/assets/UML_Solid new file mode 100644 index 0000000..a2581d6 Binary files /dev/null and b/assets/UML_Solid differ