Archive for the 'Adobe Cairngorm' Category

AIR Cairngorm / Cairngen update

Saturday, August 18th, 2007

I have updated the AIR Cairngorm framework to support itemClasses so as to allow developers to specify an itemClass on a SQLService instance.

The SQLStatement class in Adobe AIR defines a public property “itemClass” (typically a VO), which, if specified will be used as the data type for each row returned by a SQLStatement execution result.

Developers utilizing the AIR Cairngorm framework can now set a specific itemClass as an additional argument for each SQLService. execute(); invocation.

The updated source, example and air-cairngen projects can be downloaded here.

AIR Cairngorm (AIR extensions for Cairngorm)

Monday, July 16th, 2007

I have developed an open source ActionScript 3 project called “AIR Cairngorm” which is intended to provide a framework for working with the new Adobe AIR services while utilizing the Cairngorm-micro architecture.

When I say AIR Services, I am referring to the SQLite and FileSystem APIs, which are available in Adobe AIR.

AIR Cairngorm provides a framework which developers can employee to build typical Cairngorm applications that utilize these services.

The following is a brief description of the AIR Cairngorm API:

AIRServiceLocator: The AIRServiceLocator is a sub class of Cairngorm ServiceLocator, therefore it inherits the same API as ServiceLocator, and adds an additional API for working with local databases.
view source

SQLService: The SQLService is essentially a wrapper class for the SQLStatement and SQLConnection classes. The SQLService class allows developers to create an mxml implementation just as one would with typical HTTPServices, WebService and so forth in a Cairngorm ServiceLocator.
view source

ISQLResponder: ISQLResponder provides a consistent API from which asynchronous SQLStatement execution results and faults can be handled. ISQLResponder is very similar to IResponder in that it defines both a result and fault handler with a slightly different signature which is specific to a SQLStatement result / fault, (i.e strongly typed parameters).
view source

ISQLStatementResource
: ISQLStatementResource is a marker interfaces which is intended to improve code readability by indicating that a class which implements this interface is to provide access to external SQL statements defined in a .properties file.
view source

SQLStatementHelper: SQLStatementHelper is an all static utility class which provides a mechanism for substituting tokens specified in a statement with arbitrary values.
view source

I am also releasing an update to Cairngen (though only a dot release) which supports the AIR Cairngorm API. Cairngen will now provide targets for generating business delegates which utilize the AIR Cairngorm services.

I suspect Adobe will release an updated version of Cairngorm which supports integration with AIR applications. AIR Cairngorm provides an interim solution which developers can use under the terms specified in the License.

I plan to update AIR Cairngorm to support the AIR File system API within the next week or so.

Below I have provided downloads for the source, binary, AIR Cairngen and usage example:
source
example
air-cairngen
air-cairngorm

Adobe AIR SQL interfaces

Friday, June 29th, 2007

I have been working with the new SQL API for Adobe AIR which is available as of Flex 3 beta.

The new SQL capabilities provide numerous possibilities when developing online / offline desktop applications in Adobe AIR which require data to be persisted locally when not connected.

The SQLConnection and SQLStatement classes provide everything you need for working with a SQLite database. The SQLEvent and SQLResult classes provide an API into asynchronous statement executions from which query result and faults can be handled.

After initially working with the new classes I began to recognize the need for some interfaces which could assist in managing query results. With that being said I have created some straight forward interfaces which you can utilize to handle SQLConnection and SQLStatement results in order to handle SQLResults and SQLEvents uniformly.

The ISQLConnectionResponder interface defines a contract for classes that must provide an API which handles SQLEvent objects dispatched via a SQLConnection instance. The ISQLStatementResponder defines the contract for classes which must handle successfull SQLEvents dispatched via a SQLStatement instance. These interfaces are targeted at wrapper APIs for the SQLConnection and SQLStatement classes, therefore as a best practice they should be implemented in a has-a relationship design.

I am also in the process of developing an AIR specific ServiceLocator which integrates into the Adobe Cairngorm framework which will allow AIR application to utilizing the SQLite API to be built with Adobe Cairngorm. This will provide a temporary solution while we await a Cairngorm update which addresses this. As always I will publish the AIRServiceLocator as open source once completed.

Cairngen Ant Tasks 1.2 Release

Wednesday, May 9th, 2007

I have updated Cairngen to version 1.2 which introduces complete support for all Cairngorm 2+ releases as well as additional features to further improve usability.

If you are not familiar with Cairngen, it is an Ant based code generation tool for Adobe Cairngorm which allows developers to create Cairngorm project directories and classes from Flex Builder.

This latest release of Cairngen includes a few new features which have been added in addition to the original Cairngen 1.0 release which was published last week.

Below is a list of new features available in Cairngen 1.2:

  • Complete support for Cairngorm 2.0
  • Complete support for Cairngorm 2.1
  • Complete support for Cairngorm 2.2
  • Added logging capabilities for all targets
  • Abstracted user / project specific properties. User properties are now located in the project.properties file.

If you are using Flex builder as an Eclipse plugin, follow these steps to set up automatic project refreshes when using Cairngen: Select Run > External Tools > External Tools; select the build file then select the refresh tab and check the “refresh resources upon completion” checkbox. This will force a refresh everytime classes are generated to your project from Cairngen.

Download Cairngen 1.2