by asragab · 10y ago · 0 comments
I'd like to think I have read a few definitions of OOP, I have to say I don't recognize the above - what does "pinpointed procedures" mean? Also, "if-then" programming doesn't seem like a paradigm or a necessary/representative flow control structure of OOP.
To be fair, I am not familiar with Smalltalk and perhaps this definition makes more sense in that context.
I've never heard it described that way, but I assume the part about "pin pointed procedures" tied to data is a weird way of describing the way that methods relate to the data encapsulated by their owning object.
Ultimately, I think this is a case where someone familiar with the concept has explained it to someone who is not, who has then tried to paraphrase and, lacking any domain knowledge, summarised it in an unusual and vague way.
"Here is an a la carte menu of features or properties that are related to these terms; I have heard OO defined to be many different subsets of this list.
1. Encapsulation - the ability to syntactically hide the implementation of a type. E.g. in C or Pascal you always know whether something is a struct or an array, but in CLU and Java you can hide the difference.
2. Protection - the inability of the client of a type to detect its implementation. This guarantees that a behavior-preserving change to an implementation will not break its clients, and also makes sure that things like passwords don't leak out.
3. Ad hoc polymorphism - functions and data structures with parameters that can take on values of many different types.
4. Parametric polymorphism - functions and data structures that parameterize over arbitrary values (e.g. list of anything). ML and Lisp both have this. Java doesn't quite because of its non-Object types.
5. Everything is an object - all values are objects. True in Smalltalk (?) but not in Java (because of int and friends).
6. All you can do is send a message (AYCDISAM) = Actors model - there is no direct manipulation of objects, only communication with (or invocation of) them. The presence of fields in Java violates this.
7. Specification inheritance = subtyping - there are distinct types known to the language with the property that a value of one type is as good as a value of another for the purposes of type correctness. (E.g. Java interface inheritance.)
8. Implementation inheritance/reuse - having written one pile of code, a similar pile (e.g. a superset) can be generated in a controlled manner, i.e. the code doesn't have to be copied and edited. A limited and peculiar kind of abstraction. (E.g. Java class inheritance.)
9. Sum-of-product-of-function pattern - objects are (in effect) restricted to be functions that take as first argument a distinguished method key argument that is drawn from a finite set of simple names.
So OO is not a well defined concept. Some people (eg. Abelson and Sussman?) say Lisp is OO, by which they mean {3,4,5,7} (with the proviso that all types are in the programmers' heads). Java is supposed to be OO because of {1,2,3,7,8,9}. E is supposed to be more OO than Java because it has {1,2,3,4,5,7,9} and almost has 6; 8 (subclassing) is seen as antagonistic to E's goals and not necessary for OO.
The conventional Simula 67-like pattern of class and instance will get you {1,3,7,9}, and I think many people take this as a definition of OO.
Because OO is a moving target, OO zealots will choose some subset of this menu by whim and then use it to try to convince you that you are a loser."
this is an overly simplified and reduced way of describing the idea of encapsulation.
lol you would have been flamed to a crisp for saying that in the 90s.