Afficher un message
Vieux 15/02/2008, 21h00   #20
Thomas Gagne
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Difference between :: and ->

Steve wrote:
> <snip>
>> So, if I'm reading that right, you're saying that "self" and "parent"
>> always refer to the same instance of the class, regardless of what
>> instance they're used from.
>>

>
> no, i'm saying that even static singletons have instances

I thought a singleton _was_ an instance. In fact, a singleton is
intended to be the _only_ instance of a class. Isn't that why they call
them singletons?

What, then, is a static singleton?
> ...where 'self' and
> 'parent' are how you reference the class or its parent. non-singletons
> wouldn't be of much use if they *didn't* refer to their respective, multiple
> instances...they'd of course be, well, singletons.
>

A non-singleton is just another instance, but instances don't have
instances so I don't understand your comment, ".. non-singletons
wouldn't be of much use if they *didn't* refer to their respective,
multiple instances.."

--
Visit <http://blogs.instreamco.com/anything.php> to read
my rants on technology and the finance industry. Visit
<http://tggagne.blogspot.com/> for politics, society and culture.
  Réponse avec citation
 
Page generated in 0,06787 seconds with 9 queries