Design principles

Law of Demeter

Only talk to your immediate friends. A method should call methods on itself, its parameters, objects it creates, and its direct fields, not reach through a chain of strangers. An animated lesson where the diagram draws itself as the design grows.

  • Lesson 3 of 3
  • Animated diagrams

Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

3 lessons, each with diagrams that draw themselves.

What you will learn

  • Don't talk to strangers
  • The four kinds of friends
  • The fix: Tell, Don't Ask

More low-level design

Watch Law of Demeter take shape

Sign in and the lesson opens with its diagram ready to play, and the rest of Design principles beside it.

DSA comes with the all labs plan and every ChaiCode batch.