The Law of Demeter (LoD), also known as the Principle of Least Knowledge, is a design guideline for developing software, especially in object-oriented programming. It was introduced in 1987 as part of the design of the Demeter programming language. The main idea behind the Law of Demeter is to promote loose coupling between classes. It encourages a design where a given object should only communicate with its immediate friends and not with the friends of its friends.

Articles by others on the same topic (0)

There are currently no matching articles.