Law of Demeter

  • 网络迪米特法则;得墨忒耳定律;迪米特法例;迪米特规律
Law of DemeterLaw of Demeter
  1. The interesting thing about method pointers is that their use can be an indication that the code violates the Law of Demeter .

    关于方法指针,有意思的事情是:它们的使用可能就表明代码违反了迪米特法则。

  2. Using the motto Talk only to immediate friends , the Law of Demeter states that we should avoid invoking methods of an object that was returned by another object 's method .

    迪米特法则使用只与直接朋友对话这句格言指出:我们应当避免调用由另一个对象方法返回的对象上的方法。