4 ms·
" Object-oriented design isn't top-down, even when it pretends to be. The decomposition provided by objects is a model of the real world, which is after all whe
by tyingq 4y ago
" Object-oriented design isn't top-down, even when it pretends to be. The decomposition provided by objects is a model of the real world, which is after all where the idea originated"
I've seen plenty of code in "OO" languages that is just the sort of top-down imperative function type thing being described in the article. That is, people using OO solely to encapsulate state and variable scope, using methods more like functions, versus trying to model the real world as objects. I suppose though, that's not "OOD" then?
- gloryjulio 4y agoThe most usual patterns I have seen r using interfaces instead of inheritances and tagged union, and that's pretty much about it
- sdze 4y agoIsn't true OOP about Messaging and not about modeling objects of the real world?
- PhilipRoman 4y agoLike many other religions, OOP has split into several competing factions, each with a slightly different interpretation. To complicate the situation even more, in many areas of the world OOP has been mixed thoroughly with the local pre-OOP beliefs from the dark ages.
- deleted 4y ago[deleted]
- slowmovintarget 4y agoTrue OOP believers must necessarily code in Eiffel. /s Bertrand Meyer's book Object-Oriented Software Construction is just about as good as it gets for defining and justifying OOP. Still worth a read today. That said, functional programming and hexagonal architecture are probably more useful.
- tabtab 4y agoI found a lot of holes in the justification. The scenarios make a lot of questionable assumptions about how the future will change. I'll see if I can find a certain critique that used to be floating around the web...
- lightbendover 4y agoI don't think I would trust any system that focuses purely on modelling the real world.
- hinkley 4y agoWe often have to model legal constructs. Short of working for organized crime there is really no way around it.
- TeMPOraL 4y agoThe thing they don't tell you - or at least didn't tell me - at school is that the "real world" isn't... the real world. Your Cow and Car objects aren't supposed to be modeled after the real thing. The terms "cow" and "car" as you understand them aren't the real thing either. They are labels, part of some classifications, some taxonomy. Those are all human conceptual constructs, with their own synthetic rules that may or may not have some predictive power about the real world. In this sense, I'd say legal construct are much better representation of what we're modelling with OOP, because the law is obviously a human-invented game with human-invented rules. Cows and cars? They're that too, but it's not obvious.