New Pharo Collections: Question about MultiDictionary

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

New Pharo Collections: Question about MultiDictionary

Pharo Smalltalk Developers mailing list
Greetings to everyone. Recently i started my pre-bachelor's work called "New
Collections for Pharo". ( introduction to my project
<http://forum.world.st/New-Pharo-Collections-td4794762.html>  )
I decided to start with the MultiDictionary. There is a very basic prototype
available on my  project page on smalltalkhub
<http://smalltalkhub.com/#!/~OBrenchev/NewPharoCollections>  

You can also read my  post
<http://pillarhub.pharocloud.com/hub/brenchev/duntw01nrp9hkz6a00qmi16c5>  
about this implementation on PillarHub.

At this point, i need your help, users and developers of Pharo! Feel free to
make your suggestions about functionality of MultiDictionary that you need.
Also, I'll really appreciate your suggestions about code style and in
programming with Pharo in general. Thank you and best wishes.



--
View this message in context: http://forum.world.st/New-Pharo-Collections-Question-about-MultiDictionary-tp4808660.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: New Pharo Collections: Question about MultiDictionary

Max Leske

On 01 Mar 2015, at 13:33, AlexanderBrenchev via Pharo-dev <[hidden email]> wrote:


Date: 1 Mar 2015 13:24:58 CET
From: AlexanderBrenchev <[hidden email]>
Subject: New Pharo Collections: Question about MultiDictionary


Greetings to everyone. Recently i started my pre-bachelor's work called "New
Collections for Pharo". ( introduction to my project
<http://forum.world.st/New-Pharo-Collections-td4794762.html>  )
I decided to start with the MultiDictionary. There is a very basic prototype
available on my  project page on smalltalkhub
<http://smalltalkhub.com/#!/~OBrenchev/NewPharoCollections>  

You can also read my  post
<http://pillarhub.pharocloud.com/hub/brenchev/duntw01nrp9hkz6a00qmi16c5>  
about this implementation on PillarHub.


I took a quick look at the current API and I have one small suggestion: I think it would make sense to add a message #at:add: (the selector is just an example) and then use that to implement #add: like so (again, just an example):

add: anAssociation
self
at: anAssociation key
add: anAssociation value

This why users are not required to use associations, which are simply intermediate objects in many cases. If you have large collections you don’t want to create those intermediate objects.

Cheers,
Max

At this point, i need your help, users and developers of Pharo! Feel free to
make your suggestions about functionality of MultiDictionary that you need.
Also, I'll really appreciate your suggestions about code style and in
programming with Pharo in general. Thank you and best wishes.



--
View this message in context: http://forum.world.st/New-Pharo-Collections-Question-about-MultiDictionary-tp4808660.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: New Pharo Collections: Question about MultiDictionary

stepharo
Hello Alexander

May be MultiValuesDictionary would be a better name.

"As You can understand from name of this collection, the multi-dictionary is dictionary which stores a pairs which looks like "key - array of values"."

    Don't expect that people can understand...

Did you define some tests?

I suggest that you check all the dictionary API and tests.

Do you store an array or an ordered collection?

Stef



Le 1/3/15 14:39, Max Leske a écrit :

On 01 Mar 2015, at 13:33, AlexanderBrenchev via Pharo-dev <[hidden email]> wrote:


Date: 1 Mar 2015 13:24:58 CET
From: AlexanderBrenchev <[hidden email]>
Subject: New Pharo Collections: Question about MultiDictionary


Greetings to everyone. Recently i started my pre-bachelor's work called "New
Collections for Pharo". ( introduction to my project
<http://forum.world.st/New-Pharo-Collections-td4794762.html>  )
I decided to start with the MultiDictionary. There is a very basic prototype
available on my  project page on smalltalkhub
<http://smalltalkhub.com/#!/~OBrenchev/NewPharoCollections>  

You can also read my  post
<http://pillarhub.pharocloud.com/hub/brenchev/duntw01nrp9hkz6a00qmi16c5>  
about this implementation on PillarHub.


I took a quick look at the current API and I have one small suggestion: I think it would make sense to add a message #at:add: (the selector is just an example) and then use that to implement #add: like so (again, just an example):

add: anAssociation
self
at: anAssociation key
add: anAssociation value

This why users are not required to use associations, which are simply intermediate objects in many cases. If you have large collections you don’t want to create those intermediate objects.

Cheers,
Max

At this point, i need your help, users and developers of Pharo! Feel free to
make your suggestions about functionality of MultiDictionary that you need.
Also, I'll really appreciate your suggestions about code style and in
programming with Pharo in general. Thank you and best wishes.



--
View this message in context: http://forum.world.st/New-Pharo-Collections-Question-about-MultiDictionary-tp4808660.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.





Reply | Threaded
Open this post in threaded view
|

Отв: New Pharo Collections: Question about MultiDictionary

Pharo Smalltalk Developers mailing list
Thank you for all of your suggestions. I also think, that name "MultiValue Dictionary" suits to this collection much better. I am not so good at TDD for now, but I'll try to do my best. Tests are coming. Values are stored in ordered collection. So, I'll just explore the whole Dictionary API and try to rework some methods to the idea of values stored in ordered collection, if they'll need this. I'll also think about Max's idea of add: implemetation. 

Best wishes
Alexander Brenchev