3 ms·
This "law" sounds like a reasonable idea, at first, but if you think about it for a few seconds, you'll realize that it makes little, if any, sense (at least, w
by Koshkin 10y ago
This "law" sounds like a reasonable idea, at first, but if you think about it for a few seconds, you'll realize that it makes little, if any, sense (at least, when taken out of some specific context). As the designer of the class, often neither you can possibly anticipate all the ways in which objects of the classes involved will be used, nor would you want to re-expose all (or some of) the APIs provided by the "subordinate" classes.
- paulddraper 10y agoI've always thought this to. Some say the law is actually a guideline. I say it's one extreme of a spectrum, and we would do well to aim for the middle.
- coldtea 10y ago>As the designer of the class, often neither you can possibly anticipate all the ways in which objects of the classes involved will be used That's why you subclass -- or compose. The subclass can use them in other ways. The problem with what you say, that you can't "possibly anticipate all the ways in which objects of the classes involved will be used" is that if you let that happen, then you have to forever support the different ways by which they are used -- and you can't change your implementation internally, make it more efficient etc, because different external code uses various internal details of it.
- regularfry 10y agoIt's a law as in "law of nature" not "law of the land". Things which follow LoD can be observed to have certain properties.