Posts in Category "Cairngorm"

Cairngorm 2.2 Released

The beta version of Cairngorm 2.2 for Flex has been kicking around for some time now, and, on Friday, I eventually got around to getting the release version up on Adobe Labs. You can read the release notes here.

The main change in this release is the externalisation of dependencies on the Flex Data Services library (fds.swc) to a separate set of downloads called Cairngorm Enterprise.

The full list of changes in this release are as follows:

  • Removed dependency on Flex Data Services (fds.swc) – externalised to Cairngorm Enterprise
  • Flex SDK SWCs are no longer linked into Cairngorm.swc (produces a smaller Cairngorm.swc)
  • Added support for setting remote credentials
  • Fixed bug with Web services not loading the WSDL (no need to call loadWSDL() explicitly)
  • ModelLocator interface has been deprecated. Added com.adobe.cairngorm.model.IModelLocator
  • Added deprecation metadata for compiler support
  • Added dispatch() helper method to CairngormEvent class
  • Commands are now added to base Controller with weak references
  • Added removeCommand to FrontController
  • Made commands instance variable protected in FrontController (was private)

If you want a more general overview on what Cairngorm is, and what it can do for you, visit the Cairngorm page on Adobe Labs.

I’ll give the motivation behind many of these changes in future blog posts.

Cairngorm 2 – ASDoc Available

You may have seen by now that we have released Cairngorm 2 for Flex 2 over on Adobe Labs.

The Cairngorm 2 release on labs contains the source code only at the moment, but we’re very busy in the background putting together more Cairngorm documentation and samples for the Flex community.

So, with a huge thanks to Brian Deitte of the Flex Team, we’re able to provide you with the API documentation for Cairngorm 2. These docs can be downloaded from here for now, but we’ll get the up on labs over the next few days.

The API docs are in the same ASDoc format as the Flex 2 Documentation, so should be immediately familiar to you.

I’ve already noticed a few formatting errors in the docs, and we will get those fixed for the release we put on labs, but please let us know if you think anything needs changed or updated in the meantime.

You can download the Cairngorm 2 documentation here.

Cairngorm 2 Stateless Commands

You may have seen over on Steven Webster’s blog that Cairngorm 2 for Flex 2 Beta 3 has been released.

The main change in this release, compared with previous releases, is how commands are instantiated and used. I’d like to touch on the motivation behind this change.

In Cairngorm for Flex 1.x, a single instance of each command was instantiated by the controller and that one instance is used for each and every invocation of the command.

There are reasons why the original implementation was done in such a manner, mainly historical due to Cairngorm originally being developed for Flash applications, but since the advent of Flex, we’ve wanted to change it. With the API scrub taking place between Flex 1.5 and Flex 2, we see now is a good time to make this change.

Steven explains on his blog the single change you’ll have to make to your concrete front controller because of this API change.

So now, rather than the single instance of the command being used for each command invocation, the front controller now instantiates a new instance of the command on each invocation. There are a couple of implications here:

1) If, in your existing Cairngorm applications, you rely on the same command being used for each command invocation, (eg, if you store state in the command, and reuse that state on the next invocation), you will have to change your implementation. What we’d recommend here is that you store your state in your model, possibly via the ModelLocator pattern.

2) Because a new instance of the command is instantiated on each command invocation, you can now store local state in that command for the duration of its invocation. This is particularly useful for cases where you make server side calls (eg, via RemoteObject). Previously, you’d have to use a pattern such as the Asynchronous Completion Token, but now, you can store your state in a command’s instance variable in the execute() method (for example, you may store the event object), and then retrieve it again in your result or fault handler. We find this useful for cases where you want to update different parts of the model in the result handler, depending on the context of the initial command execution.

So, go get Cairngorm 2 for Flex 2 Beta 3 and let us know what you think.