>>>You cannot pass any object property by reference and that is as it should be.
>>
>>May I disagree with "as it should be"? :)
>>
>>Vlad
>
>Vlad,
>
>You can disagree with anything you like. However, passing a member of an object to another object without using the reference is a violation of everything that OO is about.
>
>An object encapsulates function and data, that data is an integral part of the object. The only way the data of an object should be affected is through the object itself. Passing a property by reference allows the data aspect of the object to be manipulated without communication with the object itself. That's why I said "as it should be." And I believe it is as it should be.
H Jim!
You are right, if parameter passing link to outside from the object.
But what if the object itself want to manipulate on its own property in one of its method, like:
this.property=upper(this.property)
BB
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