Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Why don't use Dictionary but Array to keep indices in collections?  (Read 6418 times)
xbstu2006
Newbie
*
Posts: 1


View Profile Email
« on: January 13, 2009, 09:35:01 »

Hello everybody, I'm a Chinese, my Englisgh was weak,so please take a excuse to me.

In many programming, we alaways need saving(loading) objects and keeping their indices in a collection by the key of String or any other types,
so in AS3, Adobe give us the flash.utils.Dictionary to do that specially.
It's optimized for this usage so It was faster than the Array.
In other said,Array is faster, but only in the situation when we saving Objects by the uint keys.

In pureMVC,I saw the collections like this usage are all written by Array.
( observerMap, commandMap, proxyMap, etc )
So I think would it be faster if we use Dictionary to instead Array ?

--------------------------------------------------
By the way, Mr Hall:
Thanks for your puremvc very much, it's a greate work !
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: January 14, 2009, 06:32:19 »

PureMVC is widely portable because of the original design decision not to depend on any Flex, Flash or AIR classes, only pure language elements, and then only common ones. Dictionary is a Flash class.

-=Cliff>
Logged
Pages: [1]
Print