When I was first introduced to “Object Oriented Programming” (C++), something which remained in “My Thinking” (not just the Programming World) was the idea to “Model” analysis on:
Property - Things have characteristics like Red, Blue, Green, ON, OFF, etc…
Method - Actions or the “Laws of Nature” … the Process Is ALWAYS the Same. Gravity acts on a Feather and a Bowling Bowl with the exact same “rule”, even though “observed results” are different.
Scope - Where and When Matter. “Use Case” might not be “GLOBAL” (see also “Unintended Consequences”)
I’d kind of like to know “everyone’s observation” for Scope and such between the “Programming World” and “Real World.”
Yup - It’s “Right” for Real World and Programming.
Nope - It’s Wrong. Programming vs IRL Paradigm Doesn’t Fit.
I think for OOP, there are several ways to think about it. I don’t think you gave an incorrect description. I think languages affect the implementation of models – and some are more data-oriented. For instance, naming-wise C++ might say member variables and member functions instead of properties and methods. Objective-C uses properties and methods as contrast.
Properties in a sense have a definite kind of type (yea, another word for characteristic).
Methods: this is where I see the most variability. In languages like C++, member functions can have tremendous departure from a process always being the same. They can rely on internal state of an object thus affecting observed results, but a data-oriented approach might try to dictate that data and functions are separate so that processes can be separate. The functional style may go further and insist that the functions should be immutable.
I’ll amend this with one last thought: databases are also a kind of model, http is another kind of model with definite ideas about what actions are allowed.
Anyways, fun stuff … but no consistency and lots of opinions.
I chose “it’s right” but more accurately - it was inspired by objects in reality. So it’s not the same, but it’s not accidental they you see the similarities.
A human is a class that’s a subclass of mammal, a dog is also a subclass of mammal.
Lee is an instance of human that has the properties and methods of class human with values of my own.
Methods are the actions of a class.
Inheritance - a class gets the properties and methods of its parent class with ability to override, add to or subtract.
Mammals communicate
Humans override communicate with speak
Dogs over ride communicate with bark
Humans and dogs communicate but do so according to their class.
On the “Real World angle”, people often say “It’s Not Fair” and “We’re All Equal” and they completely miss Math Concepts (like NOT EQUAL). For the “set of numbers” with 1,3,6,11,22, 42, and 99 - every number is Different, but get “Treated-The-Same” for someone who observes the “Method” is_Alphabet(n) … No Two Things Are Exactly the Same - therefore, the statement “We’re All Equal” is ABSOLUTELY FALSE (property).
Can we just teach REAL Math Concepts in the US Educational Systems?
[/rant]