Another newbie question

John J. Lee jjl at pobox.com
Mon Dec 12 17:31:11 EST 2005


Steve Holden <steve at holdenweb.com> writes:
[...]
> The "Law" of Demeter isn't about *how* you access objects, it's about 
> what interfaces to objects you can "legally" manipulate without undue 
> instability across refactoring. In other words, it's about semantics, 
> not syntax. And it's led a lot of Java programmers down a path that 
> makes their programs less, not more, readable.

Not only Java programmers -- I know I've mis-applied LoD many times.
When should it (not) be applied?  I don't find any inaccuracies in
'How to apply the LawOfDemeter successfully' at c2.com (link below),
but I couldn't call it a decent explanation of the problem:

http://c2.com/cgi/wiki?LawOfDemeterIsTooRestrictive


[...]


John




More information about the Python-list mailing list