What should the species of a Reduced Conflict collection be?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What should the species of a Reduced Conflict collection be?

Richard Sargent
Administrator
We had a customer inquiry about the species of a RcKeyValueDictionary. We all realize that the species of a collection should be as close as possible to the receiver's class. Obvious exceptions are Interval for which one cannot generally have a selection subset that is also an Interval and weak collections for which a selection subset should not be weak.

Should the reduced conflict aspect of a collection also be dropped when doing a select?
Conversely, in what scenario would one want to preserve the reduced conflict aspect when doing a select?
Reply | Threaded
Open this post in threaded view
|

Re: What should the species of a Reduced Conflict collection be?

Paul Baumann
A GS post? The list still lives!

IMO, the result should not be an RcKeyValueDictionary. Look at #speciesForSelect for other examples (CanonStringDict, RcIdentityBag, RcQueue, Repository, UserProfile, and any subclasses).

A worthy fight, but vendors don't like to change existing code even if the argument is won. It is Smalltalk, just implement what you need. For example, the Efficient GemStone Enumeration framework now implements methods like #arraySelect: as a way to gather results into an efficient form. Arguing for each of hundreds of optimizations would have been a waste of time. I've been there too many times. The GemStone release model is outdated, but is convenient for legacy customers that value a painless upgrade and are not too sensitive about inefficiencies. Once you go the route of fixing problems yourself then it is actually a blessing that vendors don't change code.

GS still implements #selectValuesAsArray: but it is commented as being obsolete in GemStone 5.0. You might use #selectValuesAsArray: until it is removed. You could add RcKeyValueDictionary>>speciesForSelect to answer Dictionary. You could implement your own.

Paul Baumann


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Richard Sargent
Sent: Wednesday, October 23, 2013 14:42
To: [hidden email]
Subject: [GemStone-Smalltalk] What should the species of a Reduced Conflict collection be?

We had a customer inquiry about the species of a RcKeyValueDictionary. We all realize that the species of a collection should be as close as possible to the receiver's class. Obvious exceptions are Interval for which one cannot generally have a selection subset that is also an Interval and weak collections for which a selection subset should not be weak.

Should the reduced conflict aspect of a collection also be dropped when doing a select?
Conversely, in what scenario would one want to preserve the reduced conflict aspect when doing a select?




--
View this message in context: http://forum.world.st/What-should-the-species-of-a-Reduced-Conflict-collection-be-tp4716694.html
Sent from the Gemstone/S mailing list archive at Nabble.com.
_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: What should the species of a Reduced Conflict collection be?

Dennis smith-4
In reply to this post by Richard Sargent
Since one wants RC because one will be adding to the collection, it
would seem unreasonable to want the select to result in a collection you
would want to add to, so why make in RC?

In the VERY unusual case of wanting a new collection you are going to
make persistent and add to later, either convert it or do it the hard way
     newColl := RcKeyValueDictionary new.
     oldColl do: [....

Or just create a new
     selectRC:
method -- its Smalltalk!


On 2013-10-23 2:41 PM, Richard Sargent wrote:

> We had a customer inquiry about the species of a RcKeyValueDictionary. We all
> realize that the species of a collection should be as close as possible to
> the receiver's class. Obvious exceptions are Interval for which one cannot
> generally have a selection subset that is also an Interval and weak
> collections for which a selection subset should not be weak.
>
> Should the reduced conflict aspect of a collection also be dropped when
> doing a select?
> Conversely, in what scenario would one want to preserve the reduced conflict
> aspect when doing a select?
>
>
>
>
> --
> View this message in context: http://forum.world.st/What-should-the-species-of-a-Reduced-Conflict-collection-be-tp4716694.html
> Sent from the Gemstone/S mailing list archive at Nabble.com.
> _______________________________________________
> GemStone-Smalltalk mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk

--
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada                     http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

_______________________________________________
GemStone-Smalltalk mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk