The principle of least knowledge (Law of Demeter) - Talk only to your immediate friends
- We should only invoke methods that belong to:
- The object itself
- Objects passed as a parameter to the method
- Any object the method creates or instantiates
- Any components of the object (HAS-A )
- Reduces the dependencies between objects
- Reduces software maintenance
- Help with debugging
Niciun comentariu:
Trimiteți un comentariu