`
heipark
  • 浏览: 2100496 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Law of Demeter 笛米特原则

 
阅读更多

More formally, the Law of Demeter for functions requires that a method M of an object O may only invoke the methods of the following kinds of objects:

  1. O itself (方法自身)
  2. M's parameters (方法参数对象方法)
  3. any objects created/instantiated within M (方法中创建对象的方法)
  4. O's direct component objects (对象的实例对象的方法)
  5. a global variable, accessible by O, in the scope of M (对象方法范围内可以访问的全局变量)

更多:http://en.wikipedia.org/wiki/Law_of_Demeter

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics