Why is this legal?
Posted: Fri Aug 07, 2009 12:16 pm
by allistar >> Mon, 2 Dec 2002 21:49:40 GMT
Hi there,
I have a class called "Customer". On that class is a method called "doIt" and one called "doIt2". Both of these methods are protected.
In the doIt method in one Customer instance I call the "doIt2" method
for a different Customer instance. The Jade compiler is happy with
that. I don't think this should be legal as I am now calling a
protected method on a different object (granted both objects are of
the same type, but they are seperate instances).
Anyone else think this should be legal? You can also set
protected/read only properties on a different object in the same
fashion.
Regards,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND
Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------
Hi there,
I have a class called "Customer". On that class is a method called "doIt" and one called "doIt2". Both of these methods are protected.
In the doIt method in one Customer instance I call the "doIt2" method
for a different Customer instance. The Jade compiler is happy with
that. I don't think this should be legal as I am now calling a
protected method on a different object (granted both objects are of
the same type, but they are seperate instances).
Anyone else think this should be legal? You can also set
protected/read only properties on a different object in the same
fashion.
Regards,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND
Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------