Looking at the world of media: from music to RIA.

Vivisecting Media Code Depot launched…

May 21st, 2008 Posted in ActionScript, Flex Development, Rich Internet Applications, web 2.0

rune_flash.gifA while back I was doing some research into the Flash Local Connection and the ability to retain object typing across Flash applications. From this research came my Local Connection Manager (LCM) which I then hosted the source from my own server. Over the last few months I have also begun developing a set of helper classes that provide functionality that I tend to need from project to project. My goal with both the LCM and these other classes is to release them all under Mozilla Public License (MPL) and make them available to anyone that wants to use them. As luck would have it, a few of the projects I am working on are allowing me to use my MPL versions of the code and these means I have to make the code publicly available. This was the motivation I needed to get my Google Code repository set up.

Right now there are only three “tools” in the Vivisecting Media Code Framework but this toolset will grow over the coming year. I actually have a lot more in the wings but I want to roll them out in a logical order. One of the driving forces for this code is the Photoslider application that I am working on. Unfortunately this means that some of my core code is still pretty application specific and wouldn’t make sense to release yet.

The other driving force is a long term strategy that I have been talking about with some Interactive Architects in which we want to create a more robust development platform for RIA developers. Of course this kind of thing requires a lot of up-front planning and until that kicks in I may hold back on some code until the order makes sense. Don’t want to put the cart in front of the horse.

Not only will I be releasing “framework” code but I have some other tools that I want to release under MPL. Those may come out as just SWCs and not the full source, but I haven’t decided the full release strategy for that yet.

So, what is currently in the repository? As I mentioned about there are currently three tools:

Local Connection Manager
The Local Connection Manager provides a simpler interface to the Flash Local Connection system. This class provides all the default error and event handling for establishing a connection and also enables developers to retain strong types across Flash Applications. This means that if you create a custom MyObject and send this through the LCM then the receiving Flash app will parse the sent data as a MyObject object. The LCM also handles error messaging better so that if the an error occurs such as unknown type in the callee application then it the LCM will inform the caller Flash app that an error occurred. If you have ever worked with Local Connections then you know this kind of thing can be a pain in the arse. I have some other ideas for this class so expect future changes. (Works with AS3 and Flex projects)

Event Broker
The Event Broker is based partly on the Observer pattern. If you do a lot of Flex development then you are pretty familiar with the ActionScript 3.0 event model. One of the challenges with the Event model is that to receive the objects Event you either need to know the location of the object so you can register to the event or be in the Events bubble chain. In most cases this is not an issue, but with complex layout or dynamic environments, hooking into the event chain can be a challenge. The EventBroker handles this by providing a single point of contact that any object can both subscribe and broadcast through. This enables the developer to handle event routing for those special cases. (Works with AS3 and Flex projects)

Hash Table
The HashTable is very similar to the Flex ArrayCollection (AC) but doesn’t have a lot of the overhead that the AC adds. That and you don’t need the Flex SDK to use the HashTable. The HashTable allows you to add key/value pairs using any object type as a key. You may ask, why not use a Dictionary? Well, the HashTable adds a lot helper functionality that the Dictionary doesn’t have. Such as isEmpty, getAllKeys(), getAllItems(), removeAll(), removeItem() and length. I can’t even count the number of times I have had to create a dual array to handle some of these tasks so I finally got around and wrote an official HashTable. (Works with AS3 and Flex projects)

These are just brief descriptions of what the tools do, I plan on dedicating a full post to each tool to describe the functionality in-depth, show examples and also explain some gotchas when using them (nothing is ever perfect!). I am looking forward to this code project!

You must be logged in to post a comment.