The defining feature of object-oriented programming is that objects define their own behaviour: an object may have internal state, but it does have methods. Not everything in object-oriented programming has to be an object: for example, in Java, you can also have primitives like
ints which don’t have any methods.
So, in a given Java expression:
We know that
a must, by necessity, be an object, whereas
b may or may not be.
Which is interesting, because from a grammatical point of view,
a isn’t the object:
a is the subject of the expression: the thing which does the doing of a thing, possibly to a thing. Subject (
a), verb (
someMethod), object (
b). That’s how I was taught it in grammar school.
So, maybe, given objects only demonstrate objecty behaviour when they’re the subject of an expression, we’ve got our naming all wrong?