The weather is better, but I hope you will still find some time for reading:
Showing posts with label Law of Demeter. Show all posts
Showing posts with label Law of Demeter. Show all posts
Friday, August 11, 2023
Friday, June 17, 2022
Monday, November 16, 2015
Tell, don't ask
about rules and principles
Some time ago I wrote about the Law of Demeter, about the advantages of following this law. Today I would like to write about the “Tell, don’t ask” principle. The principle that is, at least in my opinion, the starting point for the mentioned law. Following LoD is one of the consequences of applying the TDA principle.Ok, but what should we tell and what shouldn’t we ask about anyway?
Monday, October 26, 2015
Where's the law?
If you would like to describe Law of Demeter in one sentence, it would go like that: “talk only with your (closest) friends”.
In full form it tells that a method of particular object can call only methods that belong to:
In full form it tells that a method of particular object can call only methods that belong to:
- the same object,
- any object that is an attribute of this object,
- any object that was passed as a method’s parameter
- any object that was locally created.
Subscribe to:
Posts (Atom)