Archive for the ‘Projects’ Category

as3-collections hosted on code.google.com

Tuesday, August 14th, 2007

Instead of posting a bunch of crap here about this project, I am just going to develop it, and then post when I feel it is important. The links relevant to the as3-collections project are the google code project home, the documentation, and the source code which you can browse:

Google Code and Repo Browser:
http://code.google.com/p/as3-collections/
http://as3-collections.googlecode.com/svn/trunk/src/com/as3collections/

Docs:
http://specialrelativity.org/projects/as3-collections/docs/

If you have an SVN client and would like to check out the code, you can do so with the following line:

svn checkout http://as3-collections.googlecode.com/svn/trunk/ as3-collections

Sorry for tearing down those other posts.

-M

Discussion: Collections in Actionscript 3?

Sunday, August 12th, 2007

I’ve seen a few collection frameworks in Actionscript, but you never really here of any of them being used as a standard. That kind of acceptance is hard anyway, but I’m really surprised that it hasn’t happened in the community. I think for the longest time the argument was simply that having that kind of extra weight was unjustified, and was strengthened by the fact that Arrays quite simply are much faster. But those are forgotten times, aren’t they? I mean with everyone on the OOP kick. I don’t know, I wanted to put some stuff together just to see how useful a collection framework would be, and how much of a performance hit I would take by using one.

Rather then adopt one I decided to take a stab at implementing it (silly me), after all it’s just for experimenting right now. I’m opening this thread as a discussion about what I plan on doing, and what I am thinking. I will work on it gradually, each time I change a major component, or release a new component altogether it will be in its own post.

Now unfortunately, I’m just not that smart :-\, sorry. So I’ve spent some time looking into it, and picked up some books. I wanted to make a note of one of them though, because it has proven to be incredibly helpful. It’s “Data Structures and Algorithms with Object-Oriented Design Patterns in Java by Bruno R. Preiss”. Check it out. If you’ve read it you would notice that it is an obvious source of the inspiration for my code. The thing to remember is that Java and Actionscript, while similar in syntax, are two very different languages, so my code will differ where things can be done in a way that is more appropriate for Actionscript.

For simplicity and the sake of performance I am going to stick with using Array and Dictionary objects for the implementations of the different data structures.

My initial effort is to get the following done relatively soon.

  • Collection
  • AbstractCollection
  • Stack
  • Queue
  • Tree
  • BinaryTree

There is a lot more to be done then that, but I think its a fair list to commit to for now. Of course any of these could probably be put together quickly if need be, however I want to focus on making a useful framework of collections, something reliable.

I decided to set up a google code project for it, who knows, may just be wasting time.

project:
http://code.google.com/p/as3-collections/

svn:
http://as3-collections.googlecode.com/svn/trunk/

So, if you don’t here from me for a few days, you know why :) Although I’m going to try and get at least the basic containers out tonight, or tomorrow morning.