Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
True object oriented?
Message
De
05/11/1999 13:28:04
Walter Meester
HoogkarspelPays-Bas
 
 
À
04/11/1999 19:30:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00285641
Message ID:
00287667
Vues:
28
>>>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.

Hmmm. I wish I could find the docs. To me (personally) epsecially parameter overloading is a part of OOD. Why ? It help to abstract problems for example:

oBankaccount1 = oBankAcount1 + oBankaccount2

This example adds an bankacount (2) to another bankaccount (1). You actually hides the implemention of the action.

>>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.

I know, I actually agree. But many OO pureist may think diffent here.

>> 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.

Objects should be fully encapsultated. You may only use methods to access properties. This is what i've learned about OO. I certainly somewhat disagree with these statement as it's much more comfortable to access the properties directly. Maybe the reason behind this rule is that if you access properties directly you can't you're less flexible with changing the implementation of the object (you can't change names of the properties, change types, and write events on changin the properties). VFP 6.0 seems to have found a workarround for this by using the ACCESS and ASSIGN events.

>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.

Hmmm interesting. In real life you can send a E-mail to a person.

oE-mail >> oPerson

Yet another example why I do regard parameter overloading to be very important in OO models.

Walter,

>
>Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform