Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Programmation Orientée Object
>>Operator and parameter (?) overloading are NOT characteristics of OO.
>
>Err.. I meant function overload. Sorry for that mistake.
>
>They may be not a part of the basics of OO, they're certainly strongly related.
Both operator and function overloading can be provided by a procedural language. The overloading of methods (member operators are just a special case of method) is just an extension to objects.
I would say that overloading is a possible feature of strongly typed languages, but it does not affect OO.
>Well, Maybe I should have said that C++ violates certain OO principles.
Like?
>First off C++ is a hibride OO language supporting both OO and procedural code.
Yes, but this does not stop anybody from using it strictly as a OO language. C++ has powerful features that make global names (variables and functions) unnecessary.
> There are also posibilities to access properties from outside of the object. Though this ease the pain of accessing them trough methods it does violate the OO approach.
Why does it violate it? While I am one of the biggest fan of accessor methods, I wouldn't like to be forced to use them.
IMHO, in real life, objects have properties, in order to make OOP a better method to develop programs, programming objects must also have properties. After all, why is it OOP better than PP? Because it provides a way to model the reality more like it really is.
Vlad
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement