| > However, as the years went by, people started to realize that the strict approach to object orientation created a number of problems. These problems tended to be of the kind that makes code complex, hard to understand, and hard to test. No, ease of testing is one of the reasons for OO adoption, and probably the primary reason software is much more stable than it was in the mid 90s. > Many of those higher-level classes are “polluted” with methods and properties that are only relevant to a small number of subclasses. Well, then it's broken and needs to be refactored. > During my last couple years working at Google, I created a new user interface toolkit called “Quantum Wiz” Of course, in true Google style, you wrote something from scratch instead of refactoring the old. > composition > inheritance Not a new finding. I learned this in 2000, at the peak of OO craze. > Because object oriented inheritance is about organizing things into classes, it doesn’t model the real world very well; what it does model well is the way humans think about the real world. That's the idea. Good software is written for the simplicity of those poor slobs charged with maintaining it -- often ourselves a year later. > A physical object has many uses other than the specific purpose for which it was built. I can use a coffee cup as a paperweight or a doorstop; The whole idea of modeling is to remove certain details! Otherwise the model would be identical to the genuine article, and would provide no benefit. |
Refactoring means the original design didn't handle change well. Refactoring is badge of disgrace, and should not be considered a standard practice any more than putting out kitchen fires should be considered a standard practice of cooking. One of the key points of abstraction is to make the code change-friendly. If you have to refactor, the code failed that job. Minor rework is expected upon new requirements, but complete structural overhauls should be avoided, in part because it can create cascading side-effects.
Re: The whole idea of modeling is to remove certain details! Otherwise the model would be identical to the genuine article, and would provide no benefit.
But in some cases OO-based modelling becomes awkward or forced. Does the action of "gluing" belong with the glue or with the object being glued (fixed)? We can force it to be with one or the other to satisfy "OO rules", but that doesn't necessarily mean it's a good model. It's a forced model.
Re: [article] it doesn’t model the real world very well; what it does model well is the way humans think about the real world.
It doesn't model all thinking well. For smaller sub-systems it's fine. But OOP seems to get messy and tangled on a larger scale.