You are currently browsing archived articles from

Cairngorm 2.1 Released

Monday, October 30th, 2006

Adobe has released Cairngorm 2.1, which is received with a warm welcome on my part. In this latest release of Cairngorm Adobe has deprecated many of the core interfaces that were an integral part of Cairngorm 2.0. The deprecated interfaces are still available in Cairngorm 2.1, however they now extend the interfaces which replace them, so should you choose to upgrade to version 2.1 your exisiting Cairngorm applications should not degrade. The only exception being the Responder interface which is still provided but officially deprecated. Additionally, Adobe has added some new core Cairngorm classes and interfaces which are better suited towards building RIA’s with Cairngorm in Flex 2.0.

The first addition that you will notice is the CairngormError class which is used to throw errors specific to a Cairngorm Application. A Cairngorm Error excepts an error code parameter and an additional parameter of arbitrary length. Cairngorm errors also provide a resourceBundle property which returns a read-only instance of the error specific resourceBundle which is be used to localize an application in a single properties file. The properties file is supposedly exactly like a Java-based properties file which contains name-value pairs, However, Flex expects UTF-8 while Java .properties expect Unicode escaped ASCII.

The second addition that you will notice is the CairngormMessageCodes class which contains a list of static constants which represent the codes found in the file mentioned above. The inclusion of the .properties file in Cairngorm 2.1 actually happens to answer a question that came up during a conversation I had today with one of our Java developers regarding utilizing files in ActionScript 3.0, so how’s that for perfect timing.

The Command interface is now deprecated in place of the new ICommand interface which enforces the contract between the Front Controller and concrete command classes and is a direct implementation of the Command Behavioral Pattern.

The Responder interface has been deprecated and replaced with the core mx.rpc.IResponder interface which essentially provides a similar method signature. IResponder result must be implemented with a data parameter of type Object and fault must be implemented with an info parameter of type Object. For instance, the Responder interface in Cairngorm 2.0 contained 2 methods, onResult and onFault, both of which required a single parameter of arbitrary type, whereas the IResponder interface simply contains a result and fault method which except a single Object as a parameter.

The ValueObject interface has been deprecated and replaced with the IValueObject interface, which is essentially the same marker interface containing the I prefix as a best practice.

ServiceLocator has had a major rework. ServiceLocator.getService() has been deprecated and replaced with ServiceLocator.getRemoteObject(string). ServiceLocator.getInvokerService() has been deprecated also. An IServiceLocator interface has been created to support unit testing and there have been additional security methods added to ServiceLocator.

The FrontControler executeCommand() and getCommand() access modifier visiblity have been changed to protected.

All in all it is a pretty significant release and answers a few questions that I have had. I am an advocate of Cairngorm and support it’s development as a micro-architecture for developing enterprise RIA’s in Flex 2.0 and ActionScript 3.0. To learn more about Cairngorm 2.1 click here. You can also download Cairngorm 2.1 here.

Adobe Soundbooth Preview

Friday, October 27th, 2006

Adobe has released a preview of Soundbooth, their new audio editing software. Being that I used to be involved in audio production and sound design (check out my music site) I look forward to trying this one out for myself.

After a quick and easy install my first test was to see what file types Soundbooth supports and I was happy to see that 24bit .wav files are supported as well as most other standard audio file formats. A quick peek in the effects panel reveals that Soundbooth provides some basic audio effects such as chorus, flanger, vibrato and analog delay. The effect algorithms closely model their hardware equivalents and are a pretty good match in comparison to most effect units available today. However, the lack of a reverb unit is a bit of a let down. All of the effects render rather quickly compared to most other audio editors in the same product range. The zooming features take a bit of getting used to but they work just fine for a quick audio editor. I was also very happy to see that the app has yet to crash, which is pretty common amongst audio editors in general.

All in all I would recommend using Soundbooth for quick and easy audio edits as that seems to be it’s strongest point, and being that I am used to using Wavelab and other high end audio editors says alot about Soundbooth. I am happy with my initial test of soundbooth and look forward to seeing the product develop. You should definitely give it a try.

It is really cool to see everything finally coming together and all of the pieces falling into place. Adobe has been doing a great job as far as I a concerned. We now have a solid framework in which to build robust applications – Flex 2.0 built on Eclipse, as well as the Flex 2 SDK allowing anyone to develop applications in ActionScript and compile Flash content. Photoshop will now integrate seamlessly into Flash Professional 9 allowing designers, animators and developers to have a truly integrated work flow. Dreamweaver is being geared towards enforcing best practices in regards to css and xhtml validation. The Spry framework provides a framework for developing AJAX applications, the FlexAJAXBridge fills the gap between Flex apps and AJAX apps rather than building around proprietary technologies. And then there are all of the other things such as ASDoc which is invaluable in my opinion, the acquisition of Iteration 2 and Cairngorm becoming the defacto-standard micro architecture for Flex applications, and so on and so on… And now Adobe has added an audio application to fit the audio gap. And so it is really all coming together nicely.

Things have come along way in a short amount of time and it all seems to be for the better. It feels like just yesterday that the plans of the acquisition were announced. This is a great time to be a Flash Platform Developer – enjoy it.

Flex 2.0 Generic Portal Application

Friday, October 27th, 2006

I built a generic, configurable portal application awhile back which I have added to my portfolio site. I even added a background image of myself acting like a nut which has a filter effect applied to it based on the position of the mouse cursor.

The Flex 2 Portal is a simple application that is intended to serve as a central location for launching multiple applications. It works great with Firefox as each application will load in a new tab in the same browser, allowing for all of the applications to run without appearing to be disjointed. You can also just simply use it as a portal for launching other websites.

You can view the Flex 2 portal application by clicking the image below. You can also right click and select ‘view source’ from the context menu to view the source code.


AS3 PHP LoginService API

Wednesday, October 18th, 2006

This morning I wrote a quick API which allows you to easily invoke a PHP script from Flex 2, run a query on a MySQL database for authentication, and pass the results of the query back to the Flex client. The API consists of a simple login value object and a QueryService that calls an accompanying PHP script. The PHP script then runs a query based on the login value object passed in the query string as name value pairs.

The AS3 PHP LoginService API is intended to simply serve as a base class only. It is to be used as a starting point from which you can create a real world application based on sub-classing the QueryService to apply an MD5 encryption algorithm and so forth.

You can check out the example, accompanying ASDoc and source code as well as a Cairngorm 2.0 implementation which I created.

AS3 Iterator Pattern Implementation

Monday, October 16th, 2006

The greatest thing about design patterns is that they are typically not much more than an efficient, structured way of doing things that most of us have already been doing for a long time. Design Patterns allow us to simplify common design problems into standard, common named solutions. By implementing common design patterns and best practices we can keep our applications consistant without re-inventing the wheel everytime. They allow us to solve the same problems over and over again in the same way. Design patterns also allow us to write code that is common amongst other developers. This is helpful as it allows other developers who are familiar with these patterns to easily and intuitively work with our code, and vice-versa.

Every Software Developer iterates over objects on a regular basis. That is, every software developer has the need to loop thru an array or traverse an object at some point during the development of an application. This is obviously a basic part of programming so we usually don’t give it much thought. However, once in while it is good to reflect upon the things that have become routine to determine if there is a common solution out there. We often run into situations where we create an API that consists of a collection of objects that a client may want to iterate over. In order to provide the required functionality we have to define an interface in which the client can iterate over our collection without exposing the collections underlying implementation. This is where the Iterator Pattern comes in handy. Iterators are used to access the elements of an aggregate object sequentially without exposing its underlying representation. Iterators are intended to remove traversal responsibility out of the aggregate object.

I have created an AS3 Iterator API which consists of an interface (IIterator) that defines the methods which implement the Iterator Pattern. The IIterator interface is implemented by an internal base class (Iterator) which is sub classed by concrete iterator implementations (ArrayIterator, ArrayCollectionIterator and ObjectIterator). I have also provided an IteratorFactory which handles instantiating Iterator sub-classes so that they may be referenced by the same iterator instance.

You can view the example and ASDoc as well as download the swc for the AS3 Iterator API.

AS3 Custom Tween API v0.9.3

Monday, October 9th, 2006

After numerous requests I finally found the time to update my AS3 Custom Tween API to version 0.9.3.

In case you are not familiar with the Tween API it is a simple API which enables any object on the display list to have a tween effect applied to a property of the object. You can view the the original Tween API post here.

Version 0.9.3 has had the following additions implemented:

  1. Tween Interval has been increased to 30fps as oppossed to the original 12fps. The original 12fps would run slow unless the framerate of the swf was increased.
  2. A callback function can now be passed in as an optional parameter. The callback function will be invoked once the tween effect has completed.
  3. An optional callback argument of arbitrary length can also be passed in as a parameter of the callback function.
  4. An additional Tween.stop(); method has been added which will allow a Tween instance to be stopped at anytime while the tween effect is executing.
  5. TweenTarget parameter’s type has been changed from DisplayObjectContainer to DisplayObject. Originally I had wrote the Tween API as a simple, application specific API that I thought other developers could use. I have now updated the API so that it is generic and can be applied to any object on the display list.

Download source and view ASDoc.

Keep in mind that this is an unstable beta release, that is, I have not thoroughly tested the API as of this release but it does however meet the requirements that I have been requested. Once testing is completed and all bug fixes are complete I will make one last major build before a final version 1.0 release. So if you happen to find any bugs please feel free to let me know.