SplObjectStorage:
"This container allows to store objects uniquly without the need to
compare them one by one."
Unless I'm mistaken, in Java and Mathematics, this is called a Set.
"A collection that contains no duplicate elements."
Is there some reason not to name the class for the general concept? Is
there a reason to limit this class to object members?
Best Regards,
Jeff Moore
Hello Jeff,
yes, it is a conainer and not a set. And it cannot take anything other
than php objects. That's why.
Friday, January 27, 2006, 5:37:09 PM, you wrote:
SplObjectStorage:
"This container allows to store objects uniquly without the need to
compare them one by one."
Unless I'm mistaken, in Java and Mathematics, this is called a Set.
"A collection that contains no duplicate elements."
Is there some reason not to name the class for the general concept? Is
there a reason to limit this class to object members?
Best Regards,
Jeff Moore
Best regards,
Marcus
Hi, Marcus,
yes, it is a conainer and not a set.
So why not call it a container instead of storage?
And it cannot take anything other
than php objects. That's why.
SplObjectContainer?
But, then, it has that uniqueness constraint. The SplObjectStorage
name doesn't convey that idea at all.
SplUniqueObjectContainer?
From an API standpoint (rather than an implementation standpoint), I
don't understand the need for the object only constraint in PHP.
SplUniqueZvalContainer?
SplUniqueValueContainer?
SplUniqueMemberContainer?
Yours,
Jeff
Hello Jeff,
what the hell do you want?
Friday, January 27, 2006, 8:23:26 PM, you wrote:
Hi, Marcus,
yes, it is a conainer and not a set.
So why not call it a container instead of storage?
And it cannot take anything other
than php objects. That's why.
SplObjectContainer?
But, then, it has that uniqueness constraint. The SplObjectStorage
name doesn't convey that idea at all.
SplUniqueObjectContainer?
From an API standpoint (rather than an implementation standpoint), I
don't understand the need for the object only constraint in PHP.
SplUniqueZvalContainer?
SplUniqueValueContainer?
SplUniqueMemberContainer?
Yours,
Jeff
Best regards,
Marcus
what the hell do you want?
To give SplObjectStorage a better name. My best suggestion is
SplUniqueObjectContainer. There may be a better choice.
Best Regards,
Jeff
This one time, at band camp, Jeff Moore jeff@procata.com wrote:
To give SplObjectStorage a better name. My best suggestion is
SplUniqueObjectContainer. There may be a better choice.
Why not just call it Betty.
Kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."
Kevin Waterson wrote:
This one time, at band camp, Jeff Moore jeff@procata.com wrote:
To give SplObjectStorage a better name. My best suggestion is
SplUniqueObjectContainer. There may be a better choice.Why not just call it Betty.
Kevin
+1 for Betty!
To give SplObjectStorage a better name. My best suggestion is
SplUniqueObjectContainer. There may be a better choice.Why not just call it Betty.
Why not? "Betty" is only slightly more vague than "Storage." A vague
name is nobody's friend.
Here is a sitepoint thread where a use of SplObjectStorage is discussed.
http://www.sitepoint.com/forums/showthread.php?t=339769
I'm just trying to point out that the class may have a broader use than
the context in which it was conceived and that the name could better
reflect its function.
AFAIK, SplObjectStorage is targeted for PHP 6. I'm not suggesting
changing something that has been in PHP for half a decade. Is this not
the appropriate time and place to give feedback about API design
issues?
Best Regards,
Jeff
Hi Jeff,
Why not just call it Betty.
Why not? "Betty" is only slightly more vague than "Storage." A vague
name is nobody's friend.
"SplObjectStorage" is some thing which stores objects, that can be read out of
the name so it at least gives an idea and compared to your
"SplUniqueObjectContainer" it's quite short.
AFAIK, SplObjectStorage is targeted for PHP 6. I'm not suggesting
changing something that has been in PHP for half a decade. Is this not
the appropriate time and place to give feedback about API design
issues?
It's part of PHP 5.1.2.
johannes
"SplObjectStorage" is some thing which stores objects, that can be
read out of
the name so it at least gives an idea and compared to your
"SplUniqueObjectContainer" it's quite short.
There are many ways to store objects. Arrays can store objects, too.
What makes this class different?
It's part of PHP 5.1.2.
I didn't realize that. If I had, I probably wouldn't have posted in
the first place. These things get in so fast and I rarely see any
discussion on them. My goal in posting was to provoke some discussion
before it was released.
Best Regards,
Jeff
"SplObjectStorage" is some thing which stores objects, that can be
read out of
the name so it at least gives an idea and compared to your
"SplUniqueObjectContainer" it's quite short.There are many ways to store objects. Arrays can store objects, too.
What makes this class different?It's part of PHP 5.1.2.
I didn't realize that. If I had, I probably wouldn't have posted in
the first place. These things get in so fast and I rarely see any
discussion on them.
It was added Sept. 15, while 5.1 was released 3 (three) months later (Dec. 19).
(See here: http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_observer.c?view=log)
I think 3 months is more than enough time to discuss a name of a class.
Actually, betas and RCs are released exactly for that - to discuss and to test new changes and additions.
--
Wbr,
Antony Dovgal