Hi Alex,
Why do you say that they do not have the same behavior? They both
return a collection with all the instances of the given Class from the
group.
Is just that the SetupStorage stores elements in an ArrayList, which
makes it faster to add elements, while the RuntimeStorage has a more
elaborate caching mechanism (for example byGroup) for retrieving
elements faster.
Cheers,
Doru
On 27 Nov 2009, at 18:39, Alexandre Bergel wrote:
Dear List,
While programming with Simon, we bumped into a sensible issue.
Consider the two following methods:
SetupStorage>>selectAllWithType: aSmalltalkClass
^ self select:
[ :each |
"-- select returns an ArrayList"
each isKindOf: aSmalltalkClass ]
RuntimeStorage>>selectAllWithType: aSmalltalkClass
^ byGroup
at: aSmalltalkClass
ifAbsent: [ OrderedCollection new ]
These two methods do not have the same behavior.
We could have something starting with "(byGroup keys select: [:cls |
cls isKindOf: aSmalltalkClass]) ..."
But that would defeat the whole idea of having different storages...
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Be rather willing to give than demanding to get."