|
|
|
|
|
by rramadass
1099 days ago
|
|
Not quite sure what you are trying to say here; but ... > the dichotomy of 'implementation' vs 'interface' is drawn on the exact same line as 'variables' and 'functions'. That's not true; They are orthogonal to each other. OOP is just a way of structuring Procedural/Imperative programming; "variables" maintain state while "functions" change/read state. You are just bundling them together to gain fine-grained modularity. An "interface" is anything (i.e. can be both variables and functions) which is "publicly" accessible by a client. An "implementation" is conversely not accessible by the client (i.e. encapsulated) but can also consist of "variables" and "functions". > Why couldn't a single variable or property be virtual and polymorphic? Not sure what you mean here but you do have tagged unions/variants/sum types which gives you what you maybe looking for. > Why couldn't a member method be reassignable like a member variable? It is possible in certain object models. Lookup "Metaclasses" in your favourite language for possible support. If you want to see example code in C++, checkout the classic Advanced C++ Programming Styles and Idioms by James Coplien. The book contains lots of examples of mind-bending OO trickery using C++. |
|