Please enable JavaScript.
Coggle requires JavaScript to display documents.
SOLID Design Principle (Acroname
some principles overlay with diff view…
SOLID Design Principle
-
WHY SOLID
-
-
-
-
SOLID
-
-
-
control changes, prevent disaster
-
-
-
Details
(1)I:
-
Principle
-
or the interface should be as narrow as possible, so that client
client is dependable to smallest set of interface features or attributes
-
-
Suggest Wrap a generic interface the Extend
but Not best for Python
usually in python Extend works better Python's duck typing(automatic interface) is helpful here
Python
-
doesn't have type checking, and doesn't check
if a collaborator is compatible
-
-
-
-
(5) S:
-
one-responsibility per class, but how to define one-responsibility unit? there GRASP principle helps
Other concepts
-
-
-
duck typing in python: in a class we can directly use abstract class without declaring the abstract class, as python is dynamic language