Skip to content
kakenbok edited this page Apr 21, 2011 · 2 revisions

Goals

Release the most sophisticated collections library available for the Flash platform. Promote the project to be the Standard ActionScript Collections Framework.

  • Review and revise the API
  • Restructure the test repository
  • Add new core features

Review and revise the API

The project is currently based on a few design decisions that might hinder a fast development of the projects. E.g. a map is considered to be a collection, a linked list is not a list. These and other aspects of the API should be reconsidered and, if necessary, refactored.

Refactor tests

The collections are 100% unit tested. Since different collections have in parts the same semantics, the tests are organized in reusable modules so that tests are never duplicated. This required the setup of a rather uncommon test inventory. Adding new tests is not that easy. To enable faster development on the framework it is necessary to refactor the tests.

Add new core features

The following list is a first draft to be refined.

foreach closure iterator

Provide the ability to iterate all Collections using a forEach syntax – this is not as fast as using an iterator but provides a very simple interface for AS3 devs not used to iterators.

myCollection.foreach(callback : Function) : void;
myMap.foreachKey(keyCallback : Function) : void;

function callback(item : *) { ... }
function keyCallback(key : *) { ... }

Equality based comparisions

Objects currently are distinguished by their identity. There are several requests to enable custom comparisions using arbitrary identifiers. This will require the objects to consist of specfic methods such as equals() or hashCode(). To circumvent possible barriers it always should be possible to add unspecific items to collections. A way of doing might be the approach of duck typing typing. Make sure that performance is kept as high as possible.

for..in traversals

Using proxies collections might be operated on the same way as with native containers such as Array or Object. Bottleneck could be the presence of complex keys for maps and sets since the proxy operates on String typed keys.

for each (var item : * in collection) {
    trace (item);
}
Clone this wiki locally