How do I get an object's name?
EG.
$obj_FOO = new Bar;
echo $obj_FOO->getName();
'obj_FOO'
?
I am racking my brains. 23 4189
"Hugh Oxford" <ar*****@fas.comwrote in message
news:48**********************@news.zen.co.uk...
How do I get an object's name?
EG.
$obj_FOO = new Bar;
echo $obj_FOO->getName();
'obj_FOO'
Actually what you want is the *variable* name. The object's name is
Bar...and unless Bar has a method called 'getName', you should see some
errors. As always, 90% of the questions asked here already have answers...in
TFM. Case in point:
<?php
function var_name(&$var, $scope = 0)
{
$old = $var;
if (
$key = array_search($var = 'unique'.rand().'value', !$scope ? $GLOBALS
: $scope) &&
$var = $old
)
{
return $key;
}
}
?>
HTH
Oscar Arreyano wrote:
Actually what you want is the *variable* name. The object's name is
Bar...and unless Bar has a method called 'getName', you should see some
errors. As always, 90% of the questions asked here already have answers...in
TFM. Case in point:
Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought
of an object as a variable, because you cannot change the value of it.
So I hope you can understand my confusion.
"Hugh Oxford" <ar*****@fas.comwrote in message
news:48**********************@news.zen.co.uk...
Oscar Arreyano wrote:
>Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point:
Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of
an object as a variable, because you cannot change the value of it. So I
hope you can understand my confusion.
You owe me no respect, but thanks. The name of the class is Bar, yes. Class
is more of an adjective...a 'type' of object. A variable stores a reference
to an instance of an object, not the class which defines it. Either way, I
understand the confusion of not being able to find what you were looking
for. Knowing what to ask is the key. I'm glad we've got it all sorted out.
:)
Btw, the example given, strictly, will only work if globals are turned
on...which is bad. However, there are several php functions that don't rely
on that setting but will return all defined variables...They should be used
instead, IMO.
Cheers.
Oscar Arreyano wrote:
"Hugh Oxford" <ar*****@fas.comwrote in message
news:48**********************@news.zen.co.uk...
>Oscar Arreyano wrote:
>>Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point:
Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion.
You owe me no respect, but thanks. The name of the class is Bar, yes. Class
is more of an adjective...a 'type' of object. A variable stores a reference
to an instance of an object, not the class which defines it. Either way, I
understand the confusion of not being able to find what you were looking
for. Knowing what to ask is the key. I'm glad we've got it all sorted out.
:)
Btw, the example given, strictly, will only work if globals are turned
on...which is bad. However, there are several php functions that don't rely
on that setting but will return all defined variables...They should be used
instead, IMO.
Cheers.
No, an object is an instantiation of a class. But you never could
figure that one out, could you?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Hugh Oxford wrote:
Oscar Arreyano wrote:
>Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point:
Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought
of an object as a variable, because you cannot change the value of it.
So I hope you can understand my confusion.
Yes, an object is a variable because you can change it's value. In this
case the value would be the data members of the class.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:ga**********@registered.motzarella.org...
Oscar Arreyano wrote:
>"Hugh Oxford" <ar*****@fas.comwrote in message news:48**********************@news.zen.co.uk...
>>Oscar Arreyano wrote:
Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point: Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion.
You owe me no respect, but thanks. The name of the class is Bar, yes. Class is more of an adjective...a 'type' of object. A variable stores a reference to an instance of an object, not the class which defines it. Either way, I understand the confusion of not being able to find what you were looking for. Knowing what to ask is the key. I'm glad we've got it all sorted out. :)
Btw, the example given, strictly, will only work if globals are turned on...which is bad. However, there are several php functions that don't rely on that setting but will return all defined variables...They should be used instead, IMO.
Cheers.
No, an object is an instantiation of a class. But you never could figure
that one out, could you?
I wish you could r*e*a*d*, Jerry. Here's what I said:
<quote>
variable stores a reference to an instance of an object
</quote>
A class is the mechanics that define how the instantiated object will
behave.
How can one be your age and not be able to read? Maybe you need a new
prescription for your glasses? Either way, it's too bad you have to behave
like a child. You are an instance of an imbecile and you have *no* class.
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:ga**********@registered.motzarella.org...
Hugh Oxford wrote:
>Oscar Arreyano wrote:
>>Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point:
Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion.
Yes, an object is a variable because you can change it's value. In this
case the value would be the data members of the class.
An object is a NOT a variable. How long have you been programming?!!!
$i
What methods can i enact on $i? none.
$i = 'Oh my!';
Did I pick up any interfaces yet? Maybe in javascript, perl, or .Net...but
not in php.
A variable is a reference to something in memory, be it a literal reference,
pointer, or copy of something. A variable is NOT an object.
Dunce!
Oscar Arreyano wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:ga**********@registered.motzarella.org...
>Oscar Arreyano wrote:
>>"Hugh Oxford" <ar*****@fas.comwrote in message news:48**********************@news.zen.co.uk.. . Oscar Arreyano wrote:
Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point: Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion. You owe me no respect, but thanks. The name of the class is Bar, yes. Class is more of an adjective...a 'type' of object. A variable stores a reference to an instance of an object, not the class which defines it. Either way, I understand the confusion of not being able to find what you were looking for. Knowing what to ask is the key. I'm glad we've got it all sorted out. :)
Btw, the example given, strictly, will only work if globals are turned on...which is bad. However, there are several php functions that don't rely on that setting but will return all defined variables...They should be used instead, IMO.
Cheers.
No, an object is an instantiation of a class. But you never could figure that one out, could you?
I wish you could r*e*a*d*, Jerry. Here's what I said:
<quote>
variable stores a reference to an instance of an object
</quote>
A class is the mechanics that define how the instantiated object will
behave.
How can one be your age and not be able to read? Maybe you need a new
prescription for your glasses? Either way, it's too bad you have to behave
like a child. You are an instance of an imbecile and you have *no* class.
Yes, I read what you said - and you got it wrong (again).
There is no such thing as an "instance of an object". An object exists
or it doesn't exist. Objects are instances of a class.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Oscar Arreyano wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:ga**********@registered.motzarella.org...
>Hugh Oxford wrote:
>>Oscar Arreyano wrote:
Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point: Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion.
Yes, an object is a variable because you can change it's value. In this case the value would be the data members of the class.
An object is a NOT a variable. How long have you been programming?!!!
Over 40 years. How long have you been programming? 40 days?
$i
What methods can i enact on $i? none.
It depends on the type of the variable.
$i = 'Oh my!';
Did I pick up any interfaces yet? Maybe in javascript, perl, or .Net...but
not in php.
In a broad sense, yes. You can perform concatenation on it, for
instance. If you had $i=3; you could perform other operations on it
such as addition, subtraction...
$i = new myObject().
Now $i is an object.
A variable is a reference to something in memory, be it a literal reference,
pointer, or copy of something. A variable is NOT an object.
Dunce!
If you want to go to that level, then there is no such thing as a
variable, an object or anything else. Everything is just things in memory.
But intelligent programmers don't think that way.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:gb**********@registered.motzarella.org...
Oscar Arreyano wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:ga**********@registered.motzarella.org...
>>Oscar Arreyano wrote: "Hugh Oxford" <ar*****@fas.comwrote in message news:48**********************@news.zen.co.uk. .. Oscar Arreyano wrote: > >Actually what you want is the *variable* name. The object's name is >Bar...and unless Bar has a method called 'getName', you should see >some errors. As always, 90% of the questions asked here already have >answers...in TFM. Case in point: Thanks for your help. > With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion. You owe me no respect, but thanks. The name of the class is Bar, yes. Class is more of an adjective...a 'type' of object. A variable stores a reference to an instance of an object, not the class which defines it. Either way, I understand the confusion of not being able to find what you were looking for. Knowing what to ask is the key. I'm glad we've got it all sorted out. :)
Btw, the example given, strictly, will only work if globals are turned on...which is bad. However, there are several php functions that don't rely on that setting but will return all defined variables...They should be used instead, IMO.
Cheers. No, an object is an instantiation of a class. But you never could figure that one out, could you?
I wish you could r*e*a*d*, Jerry. Here's what I said:
<quote> variable stores a reference to an instance of an object </quote>
A class is the mechanics that define how the instantiated object will behave.
How can one be your age and not be able to read? Maybe you need a new prescription for your glasses? Either way, it's too bad you have to behave like a child. You are an instance of an imbecile and you have *no* class.
Yes, I read what you said - and you got it wrong (again).
There is no such thing as an "instance of an object". An object exists or
it doesn't exist. Objects are instances of a class.
A class is a blue-print. An object is what the computer builds from said
blue-print. An object is material in memory when constructed...therefore, it
is *instanciated*. Blue-prints are nothing more than computer directives.
While losely considered, an object *is* sometimes called an instance of a
class. However, NONE of that is what I contend!!! Which is why I said YOU
CAN'T READ!!!
I merely said, yet one more time for the eternally clueless, a *variable* is
a reference to an instance of an object. Provide me ONE piece of literature
that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry!
Whether or not you consider an object to be an instance of a class or just
the computer's product from a blue-print is COMPLETELY IMMATERIAL.
Learn to read...once you do that, learn to program!
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:gb**********@registered.motzarella.org...
Oscar Arreyano wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:ga**********@registered.motzarella.org...
>>Hugh Oxford wrote: Oscar Arreyano wrote:
Actually what you want is the *variable* name. The object's name is Bar...and unless Bar has a method called 'getName', you should see some errors. As always, 90% of the questions asked here already have answers...in TFM. Case in point: Thanks for your help.
With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion.
Yes, an object is a variable because you can change it's value. In this case the value would be the data members of the class.
An object is a NOT a variable. How long have you been programming?!!!
Over 40 years. How long have you been programming? 40 days?
You obviously are a very slow learner in that case!
>$i
What methods can i enact on $i? none.
It depends on the type of the variable.
And the language you're using! Which IS the point!!! A variable IS NOT an
OBJECT. It may represent one, but it is NOT one.
>$i = 'Oh my!';
Did I pick up any interfaces yet? Maybe in javascript, perl, or .Net...but not in php.
In a broad sense, yes. You can perform concatenation on it, for instance.
If you had $i=3; you could perform other operations on it such as
addition, subtraction...
NOT in ANY SENCE. I can concatentate, do math, or whatever on it because of
its TYPE!!! TYPE != OBJECT!!!
You should have spent some of you 40+ years 'programming' in actually
reading *about* programming. :)
$i = new myObject().
Now $i is an object.
>A variable is a reference to something in memory, be it a literal reference, pointer, or copy of something. A variable is NOT an object.
Dunce!
If you want to go to that level, then there is no such thing as a
variable, an object or anything else. Everything is just things in
memory.
Not true! I cannot make an object point to another object unless it is of
the correct TYPE or has an interface to do so. You are simply building
strawmen now! A variable represents something in memory. Objects and data
types define what is IN memory and what outcomes will be produced when
consumed. It is harder to manipulate any of that without the use of
variables.
A variable is a PRONOUN for something else...*always*.
But intelligent programmers don't think that way.
'intelligent' programmers think very carefully about memory...others just
don't mind leaks. I now know the category in which you fit. That's to a
certainty. Prior to your first garblings, I thought you were just new and
naive when it came to programming.
..oO(Hugh Oxford)
>How do I get an object's name?
EG.
$obj_FOO = new Bar;
echo $obj_FOO->getName();
'obj_FOO'
?
I am racking my brains.
Question is why you need this?
Micha
Oscar Arreyano wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:gb**********@registered.motzarella.org...
>Oscar Arreyano wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:ga**********@registered.motzarella.org... Oscar Arreyano wrote: "Hugh Oxford" <ar*****@fas.comwrote in message news:48**********************@news.zen.co.uk.. . >Oscar Arreyano wrote: >> >>Actually what you want is the *variable* name. The object's name is >>Bar...and unless Bar has a method called 'getName', you should see >>some errors. As always, 90% of the questions asked here already have >>answers...in TFM. Case in point: >Thanks for your help. >> >With all due respect, the name of the class is Bar. I've never thought >of an object as a variable, because you cannot change the value of it. >So I hope you can understand my confusion. You owe me no respect, but thanks. The name of the class is Bar, yes. Class is more of an adjective...a 'type' of object. A variable stores a reference to an instance of an object, not the class which defines it. Either way, I understand the confusion of not being able to find what you were looking for. Knowing what to ask is the key. I'm glad we've got it all sorted out. :) > Btw, the example given, strictly, will only work if globals are turned on...which is bad. However, there are several php functions that don't rely on that setting but will return all defined variables...They should be used instead, IMO. > Cheers. No, an object is an instantiation of a class. But you never could figure that one out, could you? I wish you could r*e*a*d*, Jerry. Here's what I said:
<quote> variable stores a reference to an instance of an object </quote>
A class is the mechanics that define how the instantiated object will behave.
How can one be your age and not be able to read? Maybe you need a new prescription for your glasses? Either way, it's too bad you have to behave like a child. You are an instance of an imbecile and you have *no* class.
Yes, I read what you said - and you got it wrong (again).
There is no such thing as an "instance of an object". An object exists or it doesn't exist. Objects are instances of a class.
A class is a blue-print. An object is what the computer builds from said
blue-print. An object is material in memory when constructed...therefore, it
is *instanciated*. Blue-prints are nothing more than computer directives.
While losely considered, an object *is* sometimes called an instance of a
class. However, NONE of that is what I contend!!! Which is why I said YOU
CAN'T READ!!!
That's right. And an object is an instance of a class. There is no
such thing as an instance of an object.
I merely said, yet one more time for the eternally clueless, a *variable* is
a reference to an instance of an object. Provide me ONE piece of literature
that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry!
Whether or not you consider an object to be an instance of a class or just
the computer's product from a blue-print is COMPLETELY IMMATERIAL.
Learn to read...once you do that, learn to program!
Just about any of the OO literature by the recognized authorities out there.
But it's about your level of comprehension, Steve. You're just a
stoopid idiot.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:gb**********@registered.motzarella.org...
Oscar Arreyano wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:gb**********@registered.motzarella.org...
>>Oscar Arreyano wrote: "Jerry Stuckle" <js*******@attglobal.netwrote in message news:ga**********@registered.motzarella.org.. . Oscar Arreyano wrote: >"Hugh Oxford" <ar*****@fas.comwrote in message >news:48**********************@news.zen.co.uk. .. >>Oscar Arreyano wrote: >>> >>>Actually what you want is the *variable* name. The object's name is >>>Bar...and unless Bar has a method called 'getName', you should see >>>some errors. As always, 90% of the questions asked here already >>>have answers...in TFM. Case in point: >>Thanks for your help. >>> >>With all due respect, the name of the class is Bar. I've never >>thought of an object as a variable, because you cannot change the >>value of it. So I hope you can understand my confusion. >You owe me no respect, but thanks. The name of the class is Bar, yes. >Class is more of an adjective...a 'type' of object. A variable stores >a reference to an instance of an object, not the class which defines >it. Either way, I understand the confusion of not being able to find >what you were looking for. Knowing what to ask is the key. I'm glad >we've got it all sorted out. :) >> >Btw, the example given, strictly, will only work if globals are >turned on...which is bad. However, there are several php functions >that don't rely on that setting but will return all defined >variables...They should be used instead, IMO. >> >Cheers. No, an object is an instantiation of a class. But you never could figure that one out, could you? I wish you could r*e*a*d*, Jerry. Here's what I said:
<quote> variable stores a reference to an instance of an object </quote>
A class is the mechanics that define how the instantiated object will behave.
How can one be your age and not be able to read? Maybe you need a new prescription for your glasses? Either way, it's too bad you have to behave like a child. You are an instance of an imbecile and you have *no* class. Yes, I read what you said - and you got it wrong (again).
There is no such thing as an "instance of an object". An object exists or it doesn't exist. Objects are instances of a class.
A class is a blue-print. An object is what the computer builds from said blue-print. An object is material in memory when constructed...therefore, it is *instanciated*. Blue-prints are nothing more than computer directives. While losely considered, an object *is* sometimes called an instance of a class. However, NONE of that is what I contend!!! Which is why I said YOU CAN'T READ!!!
That's right. And an object is an instance of a class. There is no such
thing as an instance of an object.
Well, that's where you'd be wrong.
>I merely said, yet one more time for the eternally clueless, a *variable* is a reference to an instance of an object. Provide me ONE piece of literature that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry! Whether or not you consider an object to be an instance of a class or just the computer's product from a blue-print is COMPLETELY IMMATERIAL.
Learn to read...once you do that, learn to program!
Just about any of the OO literature by the recognized authorities out
there.
One example, Jerry. With all of that literature, I'm sure you'd have no
problem supplying me one cite.
Funny how If I'm programming in .Net (or a couple of other languages for
that matter), if I try to consume an UN-INSTANCIATED OBJECT, the error
message reads something like this:
"Object reference not set to an instance of an object."
I suppose you're come-back will be, "Well, that's microsoft for you!"
LOL.
But it's about your level of comprehension, Steve. You're just a stoopid
idiot.
My name is clearly visible on my posts. I'm not sure what you're talking
about here so, again, please have your prescription eye wear UPDATED, old
man!
..oO(Oscar Arreyano)
>A class is a blue-print. An object is what the computer builds from said blue-print. An object is material in memory when constructed...therefore, it is *instanciated*. Blue-prints are nothing more than computer directives. While losely considered, an object *is* sometimes called an instance of a class. However, NONE of that is what I contend!!! Which is why I said YOU CAN'T READ!!!
I merely said, yet one more time for the eternally clueless, a *variable* is a reference to an instance of an object. Provide me ONE piece of literature that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry! Whether or not you consider an object to be an instance of a class or just the computer's product from a blue-print is COMPLETELY IMMATERIAL.
You're contradicting yourself in these two paragraphs and should get
the terminology right before you offend others. There's no such thing
like an instance of an object, because the object _is_ the instance.
If you talk about an instance of an object, this would mean that the
object is the blue print from which the instance was created. Of course
this is nonsense, because the blue print is the class, from which the
actual objects/instances are created.
Micha
Oscar Arreyano wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:gb**********@registered.motzarella.org...
>Oscar Arreyano wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:ga**********@registered.motzarella.org... Hugh Oxford wrote: Oscar Arreyano wrote: > >Actually what you want is the *variable* name. The object's name is >Bar...and unless Bar has a method called 'getName', you should see >some errors. As always, 90% of the questions asked here already have >answers...in TFM. Case in point: Thanks for your help. > With all due respect, the name of the class is Bar. I've never thought of an object as a variable, because you cannot change the value of it. So I hope you can understand my confusion. > Yes, an object is a variable because you can change it's value. In this case the value would be the data members of the class. An object is a NOT a variable. How long have you been programming?!!!
Over 40 years. How long have you been programming? 40 days?
You obviously are a very slow learner in that case!
ROFLMAO! As if YOU would know!
>>$i
What methods can i enact on $i? none.
It depends on the type of the variable.
And the language you're using! Which IS the point!!! A variable IS NOT an
OBJECT. It may represent one, but it is NOT one.
A variable is CONSIDERED AN OBJECT in all OO programming languages -
including PHP. But you don't understand that, do you, stoopid?
>>$i = 'Oh my!';
Did I pick up any interfaces yet? Maybe in javascript, perl, or .Net...but not in php.
In a broad sense, yes. You can perform concatenation on it, for instance. If you had $i=3; you could perform other operations on it such as addition, subtraction...
NOT in ANY SENCE. I can concatentate, do math, or whatever on it because of
its TYPE!!! TYPE != OBJECT!!!
You should have spent some of you 40+ years 'programming' in actually
reading *about* programming. :)
No, a type is a TEMPLATE on how to create an object. You can't do
ANYTHING to a type.
>
>$i = new myObject().
Now $i is an object.
>>A variable is a reference to something in memory, be it a literal reference, pointer, or copy of something. A variable is NOT an object.
Dunce!
If you want to go to that level, then there is no such thing as a variable, an object or anything else. Everything is just things in memory.
Not true! I cannot make an object point to another object unless it is of
the correct TYPE or has an interface to do so. You are simply building
strawmen now! A variable represents something in memory. Objects and data
types define what is IN memory and what outcomes will be produced when
consumed. It is harder to manipulate any of that without the use of
variables.
You really should learn some terminology.
A variable is a PRONOUN for something else...*always*.
And you need to go back to 7th grade English, also. "variable" is NOT a
"pronoun" in ANY language.
>
>But intelligent programmers don't think that way.
'intelligent' programmers think very carefully about memory...others just
don't mind leaks. I now know the category in which you fit. That's to a
certainty. Prior to your first garblings, I thought you were just new and
naive when it came to programming.
ROFLMAO! But I understand you. You think you have all the answers, but
you really know NOTHING.
*plonk*
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
..oO(Oscar Arreyano)
>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:gb**********@registered.motzarella.org...
>> That's right. And an object is an instance of a class. There is no such thing as an instance of an object.
Well, that's where you'd be wrong.
>>I merely said, yet one more time for the eternally clueless, a *variable* is a reference to an instance of an object. Provide me ONE piece of literature that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry! Whether or not you consider an object to be an instance of a class or just the computer's product from a blue-print is COMPLETELY IMMATERIAL.
Learn to read...once you do that, learn to program!
Just about any of the OO literature by the recognized authorities out there.
One example, Jerry. With all of that literature, I'm sure you'd have no problem supplying me one cite.
Funny how If I'm programming in .Net (or a couple of other languages for that matter), if I try to consume an UN-INSTANCIATED OBJECT, the error message reads something like this:
"Object reference not set to an instance of an object."
I suppose you're come-back will be, "Well, that's microsoft for you!"
Something like that. But I wouldn't blame it on MS alone. In early
Pascal there was an 'object' type, and the things created from it where
the instances. So there you could indeed talk about instances of an
object. They fixed the naming with Object Pascal/Delphi.
But given that error message, you would have _three_ independent things
instead of just two as in "normal" OOP: an object, an instance and the
class. Please explain how these _three_ things relate to each other.
Micha
"Michael Fesser" <ne*****@gmx.dewrote in message
news:2t********************************@4ax.com...
.oO(Oscar Arreyano)
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message news:gb**********@registered.motzarella.org...
>>> That's right. And an object is an instance of a class. There is no such thing as an instance of an object.
Well, that's where you'd be wrong.
>>>I merely said, yet one more time for the eternally clueless, a *variable* is a reference to an instance of an object. Provide me ONE piece of literature that agrees with YOU that objects HAVE NO INSTANCES. Just one, Jerry! Whether or not you consider an object to be an instance of a class or just the computer's product from a blue-print is COMPLETELY IMMATERIAL.
Learn to read...once you do that, learn to program!
Just about any of the OO literature by the recognized authorities out there.
One example, Jerry. With all of that literature, I'm sure you'd have no problem supplying me one cite.
Funny how If I'm programming in .Net (or a couple of other languages for that matter), if I try to consume an UN-INSTANCIATED OBJECT, the error message reads something like this:
"Object reference not set to an instance of an object."
I suppose you're come-back will be, "Well, that's microsoft for you!"
Something like that. But I wouldn't blame it on MS alone. In early
Pascal there was an 'object' type, and the things created from it where
the instances. So there you could indeed talk about instances of an
object. They fixed the naming with Object Pascal/Delphi.
But given that error message, you would have _three_ independent things
instead of just two as in "normal" OOP: an object, an instance and the
class. Please explain how these _three_ things relate to each other.
There are still only _two_ things. A class, which is the blue-print, from
which a computer will build an object, the 'instance' of the class in the
more general sense.
This is not limited to just *class* objects you know. That is why is
originally described a 'class' as an _adjective_, a type of object.
Structures, Enums, Arrays, even Strings in some languages are all constructs
of most languages. They are NOT classes. They ARE objects.
All I want, with such loosely thrown about nomenclature, is for Jerry to
show me ONE piece of literature that justifies not only HIS position, but
his compelling measure of hubris in saying I'm wrong (much less the other
insults he's happy to throw about).
..oO(Oscar Arreyano)
>"Michael Fesser" <ne*****@gmx.dewrote in message news:2t********************************@4ax.com.. .
>> Something like that. But I wouldn't blame it on MS alone. In early Pascal there was an 'object' type, and the things created from it where the instances. So there you could indeed talk about instances of an object. They fixed the naming with Object Pascal/Delphi.
But given that error message, you would have _three_ independent things instead of just two as in "normal" OOP: an object, an instance and the class. Please explain how these _three_ things relate to each other.
There are still only _two_ things. A class, which is the blue-print, from which a computer will build an object, the 'instance' of the class in the more general sense.
Exactly.
Now the only question left is "what is an instance of an object", if
both mean the same as in this case? That's where all this arguing came
from initially. Given the correct description above, it simply doesn't
make any sense. How can something be an instance of itself?
>This is not limited to just *class* objects you know. That is why is originally described a 'class' as an _adjective_, a type of object. Structures, Enums, Arrays, even Strings in some languages are all constructs of most languages. They are NOT classes. They ARE objects.
Sure, no question here.
Micha
"Michael Fesser" <ne*****@gmx.dewrote in message
news:28********************************@4ax.com...
.oO(Oscar Arreyano)
>>"Michael Fesser" <ne*****@gmx.dewrote in message news:2t********************************@4ax.com. ..
>>> Something like that. But I wouldn't blame it on MS alone. In early Pascal there was an 'object' type, and the things created from it where the instances. So there you could indeed talk about instances of an object. They fixed the naming with Object Pascal/Delphi.
But given that error message, you would have _three_ independent things instead of just two as in "normal" OOP: an object, an instance and the class. Please explain how these _three_ things relate to each other.
There are still only _two_ things. A class, which is the blue-print, from which a computer will build an object, the 'instance' of the class in the more general sense.
Exactly.
Now the only question left is "what is an instance of an object", if
both mean the same as in this case? That's where all this arguing came
from initially. Given the correct description above, it simply doesn't
make any sense. How can something be an instance of itself?
>>This is not limited to just *class* objects you know. That is why is originally described a 'class' as an _adjective_, a type of object. Structures, Enums, Arrays, even Strings in some languages are all constructs of most languages. They are NOT classes. They ARE objects.
Sure, no question here.
Listen, my English is not the best, but I'm trying. Let me see if i can be
absolutely, technically accurate with all of this...
A class, really, is just a data type just as are structures (et. al.). So
this is what i mean by 'instance of an object'.
foo myFooVar;
myFooVar = new foo();
I am telling the compiler that myFooVar is strongly-typed as *type* foo. I
am then having it create an instance of foo. While there is a gray area here
as to whether or not the instance is the *class* foo or the object
instanciated is of *type* foo, *that* is the question. In most languages I
use, foo is merely a data type...telling the compiler that the variable is
an object type (which could make the compiler/language interpreter/whatever
force other constraints on the instance of the created object, such as
forcing it to inherit from a base class common to all 'objects' for the
language). Secondarily, the specifics of foo are made into an *instance of
an object of type foo*.
If there is some other work you can cite that disagrees with this, I'd
really love to see it. I'm fine admitting when I'm wrong, but I certainly
can't stand for unsupported and uneducated theoritical bashing (Jerry, not
you). I may be wrong. I just need to know I'm wrong for better reasons than
Jerry didn't like me posting off-topic questions. :)
Cheers Michael.
..oO(Oscar Arreyano)
>Listen, my English is not the best, but I'm trying. Let me see if i can be absolutely, technically accurate with all of this...
A class, really, is just a data type just as are structures (et. al.). So this is what i mean by 'instance of an object'.
foo myFooVar; myFooVar = new foo();
I am telling the compiler that myFooVar is strongly-typed as *type* foo. I am then having it create an instance of foo. While there is a gray area here as to whether or not the instance is the *class* foo or the object instanciated is of *type* foo, *that* is the question.
I don't think that's a question. For me a class is a type, simply the
description or blue print of something. And the object/instance is the
thing that's created from that description. So I don't see any gray area
there: "the instance is the *class* foo" doesn't make any sense to me,
while "the object instanciated is of *type* foo" perfectly fits.
>In most languages I use, foo is merely a data type...
Yep.
>telling the compiler that the variable is an object type
Yep.
>(which could make the compiler/language interpreter/whatever force other constraints on the instance of the created object, such as forcing it to inherit from a base class common to all 'objects' for the language). Secondarily, the specifics of foo are made into an *instance of an object of type foo*.
But here you've lost me again. IMHO you're still describing _three_
different things, while in fact there are only two. What's the
difference between the instance and the object?
Your code snippet from above simply does two things: It declares a
variable that's supposed to be of type 'foo', whatever kind of type that
would be. The second line just creates something of that type (an object
in this case) and assigns it to the variable. So where's the distinction
in object and instance coming from? That's the one thing I still don't
get. I can't even try to explain it in a logical way.
Micha
Michael Fesser wrote:
.oO(Hugh Oxford)
>How do I get an object's name?
EG.
$obj_FOO = new Bar;
echo $obj_FOO->getName();
'obj_FOO'
?
I am racking my brains.
Question is why you need this?
Micha
I would venture to say if he wanted to echo out the Object name for
whatever reason. I'm guessing of course.
Scotty This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steven Bethard |
last post by:
In the "empty classes as c structs?" thread, we've been talking in some
detail about my proposed "generic objects" PEP. Based on a number of...
|
by: Keith Rowe |
last post by:
Hello,
I am trying to reference a Shockwave Flash Object on a vb code behind page
in an ASP.NET project and I receive the following error:
...
|
by: Martin |
last post by:
I'd like to be able to get the name of an object instance from within
a call to a method of that same object. Is this at all possible?
The...
|
by: tshad |
last post by:
I have a function:
function SalaryDisplay(me)
{
var salaryMinLabel = document.getElementById("SalaryMin");
salaryMinLabel.value = 200;...
|
by: Aaron |
last post by:
I have a data sructure setup and I populate it in a loop like so:
y=0
while X:
DS.name = "ASDF"
DS.ID = 1234
list = DS;
y = y + 1
|
by: Matthew |
last post by:
I have a nice little Sub that saves data in a class "mySettings" to an XML
file.
I call it like so:
Dim mySettings As mySettings = New mySettings...
|
by: anonymous.user0 |
last post by:
The way I understand it, if I have an object Listener that has
registered as a listener for some event Event that's produced by an
object Emitter,...
|
by: yb |
last post by:
Hi,
Is there a standard for the global 'window' object in browsers? For
example, it supports methods such as setInterval and clearInterval, and...
|
by: Andrus |
last post by:
I'm implementing entity object which should populate its properties from
database when property is first referenced.
In RDL reports I use object...
|
by: Astley Le Jasper |
last post by:
Sorry for the numpty question ...
How do you find the reference name of an object?
So if i have this
bob = modulename.objectname()
how do...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
| |