I’m posting this here so I’ll remember it, and because it’s one of those simple things that people in software development often forget. A method of an object should invoke only the methods of the following kinds of
objects:
- itself,
- its parameters,
- any objects it creates/instantiates;
- its direct component objects.
I read about the Law of Demeter at javaguy.org
Related posts:





Leave a Reply