53

迪米特法则与重构 | 斑斓

 6 years ago
source link: http://zhangyi.xyz/demeter-law-and-refactoring/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
在面向对象设计的世界里,有一个寻常却又常常为人所忽略的原则——“迪米特(Law of Demeter)”法则。这个原则认为,任何一个对象或者方法,它应该只能调用下列对象: 该对象本身 作为参数传进来的对象(也可以是该对象的字段) 在方法内创建的对象

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK