Wednesday, May 20, 2009

Merapi is Open!

I was proud to announce with Andrew Powell today at 360 Flex | Indy, that Merapi is now officially open source.

We've released the first public beta on Google Code as well as opened a Google Group. There is also a repo for Merapi examples.

Here are the important links:

http://merapi.googlecode.com/
http://merapi-examples.googlecode.com/
http://groups.google.com/group/merapi-project

To find out more, keep an eye on our blogs. We'll be releasing more tutorials and answering questions as they appear.

Sunday, May 3, 2009

Joining Roundarch / Merapi Positioning

On March 9th I began a new position in the role of Technical Architect and Evangelist at Roundarch. As I stated in my previous post, this was a difficult decision to make.

Now that I've had a couple months of settling in, I'm happy to say I'm enjoying my new role and the team at Roundarch very much.

Roundarch is not just an RIA or technology shop. We are specialized in Information Architecture, Graphic Design, User Experience, Technology and SEO. Our work is in serving clients, and our process provides unique advantages to the fortune 100/500 enterprises we engage with.

Now that I've had some time to get to know many of the 175 people that make up Roundarch, I've learned to appreciate Roundarch's holistic approach towards solving problems. Although we do have experts that work within a discipline, we do not develop solutions in a vacuum. There is a belief at Roundarch that all disciplines (IA, UX, Design, Business, and Technology) should inform each other. This adds up to a group professionals who's combined background includes graduate and post graduate level training in; HCI, Computer Science, Design/Art, Business Administration, etc... all working together as a team to create solutions for our clients. That process is exciting to be a part of.

There were many incentives that influenced my decision to join Roundarch. A few highlighted reasons are:

  1. Leadership that believes in the success and direction of the company.
  2. Working with my friend Dave Meeker on Merapi
  3. Working with my new friend and mentor Gary Schwartzbard in the Roundarch RIA practice.


1. The Leadership

Roundarch's history comes from years of working under the Deloitte and WPP flags. Our owners saw a distinct value in the people that became the founding members of Roundarch and purchased the practice from Deloitte. It is a testimony to the leadership that many of the founding employees are currently managers, directors, and VPs even today. This is a leadership the has a clear vision of serving it's clients and valuing it's employes.



2. Dave and Merapi

Another part of my on-boarding to Roundarch was working with my friend Dave Meeker to develop Roundarch's capability's to offer unique services leveraging Merapi. Most recently we've done this by assisting Tesla Motors in the release of their new Model S electric car. You can read more about our involvement with Tesla on the Roundarch blog and in this press release.

Shortly after the release hit the web, there was a bit of a surprise in the Merapi community about our positioning around Merapi. Pieces of the text were (validly) interpreted by some to read that Roundarch now owned / had purchased Merapi. This is not the message that Dave or I intended to publish. Roundarch has and will invest time and money in promoting and developing the Merapi technology, however, we view the open source effort as a key part in the success of Merapi.

Last week my friend Andrew Powell raised some concerns over the future of Merapi, and the position of the open source project. For those of you in the RIA community, you've probably seen Andrew give talks about Merapi over the last year. He's been instrumental in helping develop the concepts of Merapi and has helped promote the technology in a great way. Moving forward, Andrew will sit with me as co-chair of the open source project and help to ensure that a community focused version of Merapi's Flex/Java connectivity thrives.

This week Andy, Dave and I spoke about what might be the clearest, mutually beneficial way to position Merapi for the community and companies like Roundarch that want to invest in developing commercial solutions with it. Here's what we came up with...



The open source / community effort will be known as:

Merapi or The Merapi Project

The Roundarch commercial effort will be known as:

The Roundarch Merapi Platform

The open source effort will target developing a solid core for Flex/AIR and Java. Andy and I will be handling how to approve members of the community who would like to contribute on the project. We'll likely be asking for individuals or corporate entities to contribute first by submitting patches and then elevate their status to full commitor rights. This effort will begin this summer.



3. Gary and the RIA practice

At Roundarch we don't follow the typical manager / employee hierarchy. Instead, each employee has their own career counselor. I consider it a privilege to have Gary as a counselor and mentor. It's been my pleasure to get to know and work with him on a few projects already. Even in the current economy, we're in need of additional resources for this team and others. Contact me at adamflater [at] gmail [dot] com if you're interested in finding out more about Roundarch.



So.. that's a rather lengthy source-code-less post for me.

thanks for reading the update.. more to come on RIA development soon
-adam


Saturday, March 7, 2009

Farewell to Universal Mind

After much deliberation, earlier this week I chose to step down from my position at Universal Mind. This was a difficult decision for me as UM has a unique collection of highly talented individuals that I've thoroughly enjoyed working with. I will truly miss counting all the great people at UM as colleagues. I leave my best wishes to the success of Universal Mind and all of it's employees as individuals. I am certain that we will continue to see amazing work from the UM team in the RIA space in both development and design.

It was great to work with all of you and I hope to cross paths with each of you again soon.


-adam

Sunday, February 1, 2009

Cairngorm Top 5 Tips - Number 3 - The Data Translator Pattern

Number 3 on my list of Cairngorm tips is the Data Translator pattern. I'd like to preface my explanation of the pattern with a discussion about web application domains.

As Flex developers we're often inclined to use server-side technologies like Blaze DS, LiveCycle DS, ColdFusion, amfPHP, RubyAMF because of the native object transfer layers that these technologies have available. The magic in these solutions is a binary format called AMF (Action Messaging Format). AMF allows disparate languages to communicate with native objects. For example, in a Blaze DS Java server project if I define a class that has the same public properties as a class definition in ActionScript, Java and ActionScript can transport data of this type and deal with the data as a native object instance in each layer. The benefits gained from native object data transfer are: compile time type checking, speed, and elegance. However, this post is not about AMF, but about the pattern of translating other data formats (like XML, CSV, JSON) into the Flex application domain.

An important distinction when implementing a Flex application is the separation of domains. In a typical web application there are several domains to think about, but for the sake of this example let's look at two: the service layer domain and the UI domain. The distinction between these domains is important to ensure high standards of maintainability and modularity. It is essential to avoid a situation where a change in the service layer has major impacts on the implementation of the UI layer, and vice versa. The Data Translator pattern is a simple pattern, but an important concept for keeping these concerns separated.

In this example I will be using XML translated to ActionScript VOs (value objects). XML is a common format in the world of web services, and especially in Flex development, however this pattern can be used with nearly any data format that a service might expose. That's enough setup, now let's dig in to the Data Translator.

A Data Translator is a class with static methods for parsing data generated by the service domain into a format that is specific to the UI domain. Data Translators are typically invoked by Delegate classes. In my opinion, the Delegate layer is the appropriate place to handle data translation. If your Command class is dealing with data that is part of the service domain, you may need to rethink your architecture. Like nearly everything in any field of engineering, there are exceptions to this rule. If you are implementing an application that's function is to display read-only data, XML can be a great format for that application. However, if your application involves modifying data that was retrieved from a service, value objects are usually the best solution.

So, let's check out the example application:


View the Application | View the Source | View the Docs


DataTranslatorExampleApplication - Defines a button that dispatches the GetItemsEvent, a console to show Cairngorm actions, and a DataGrid to show the result of the operation.


ItemsCommand - Invokes the getItems operation on the delegate class and by standard Cairngorm convention, updates the global model with the items returned by the delegate.


DataTranslatorExampleDelegate - This delegate is responsible for calling the service that responds with a collection of items. The items are returned in an XML format and then parsed by the ExampleDataTranslator class.


ExampleDataTranslator - Translates the XML payload into a set of objects of type Item.


Item - A value object that models the data of an "Item"

This pattern is a favorite of mine for dealing with the translation of data into a format for the UI application domain.



Up next, tip #2 Aggregated Commands.





Wednesday, January 28, 2009

Typinator and Flex

My colleague Doug McCune sent out a link last week to a product called Typinator.


Typinator is a tool for Mac OS that auto replaces character strings that are typed anywhere in Mac OS. In the videos below you will see a few ways that Typinator can be used in a Flex development environment.

Class Templates: If you're tired of formatting your classes to read a certain way, why not setup a template with Typinator?

In this example you'll see "-pc" expanded to a full class template.


Infrequently Used Syntax: If you're like me, there are a few syntactical parts of ActionScript that you use infrequently. I generally have to look these things up in past source code or LiveDocs. Typinator is a great way to create a shortcut for those items.

In this example you'll see "-ra" expanded into the remote alias meta data tag.


In this example you'll see "-emd" expanded to the event meta data syntax.


I've been using Typinator for a while now and it's become a useful development tool for me, even actions as simple as correcting functino to function (a common misspelling for me).

[UPDATE]

I shared my post with Ergonis Software and their CEO and Frounder Christoph Reichenberger replied with a very helpfult tip. Typinator allows you to specify an alternative cursor position after it has replaced the phrase you type.

If you look up at my remote alias example, you'll notice that I used the left arrow key to backup to the appropriate spot to type the classname. In the revised example below you'll see that after typing "-ra" the cursor is automatically positioned where I'd like to start typing the name of the alias.


Thanks for the tip Christoph, much appreciated.


Tuesday, January 27, 2009

Cairngorm Top 5 Tips - Number 4 - The EventGenerator

The last tip in this series was #5. The AnnounceFaultEvent (read more).

and now for tip #4:

The EventGenerator

The EventGenerator class provides a mechanism for defining sets of Events to be dispatched either sequentially or in parallel. The EventGenerator is defined declaratively in MXML. The generator provides an aggregated result response when the last event in the set has finished. It is still possible to attach responders to your individual events, as per normal in the UM Cairngorm world. (I'll cover the Event-Responder relationship in more detail in a later post.)

There are couple of dependencies to the EventGenerator pattern. I consider these requirements good practice anyhow, but you should keep them in mind.

1. Define your event as a subclass of UMEvent not the Cairngorm Event Class
2. Define your command as a subclass of the UM Command class instead of implementing the Cairngorm ICommand interface.
3. Invoke super.execute() in your command execute method.
4. Invoke notifyCallers() in your command class when the command has finished executing.

And now for the example...

View the Application | View the Source | View the Docs


EventGeneratorExampleApplication - Defines the generators and the handlers functions for their results.


GetConfigurationEvent and DownloadSomethingEvent are basic Event classes that map to ConfigurationCommand and DownloadCommand, respectively. Both of these commands are implemented using the pattern I described in the dependency list above. Let's take a look at the ConfigurationCommand as an example.


As you can see, ConfigurationCommand overrides the execute method and invokes the super execute method. Finally, when the delegate has returned a response notifyCaller is invoked. This is the signal the EventGenerator needs to know that the command has finished executing. If the generator is triggered as a sequential dispatcher notifyCaller() signals the generator to dispatch the next event in the series. If the generator is running in a parallel mode, notifyCaller() is used to keep a count of the event / command pairs that have finished. When all the events have signaled a finish, then the generator will dispatch the aggregated result signal.

The delegate used (EventGeneratorExampleDelegate) is fairly straight forward. It uses a URLLoader to download a couple of files from the same server that the application is deployed on.

Up next, #3 Data Translators.

Monday, January 26, 2009

Cairngorm Top 5 Tips - Number 5 - The AnnounceFaultEvent

Several months ago we had a Flex Frameworks roundup at our local Adobe User Group (RMAUG). I presented on the Universal Mind Extensions to Cairngorm and have since had a few requests for more info on the extensions. In this post I will explain my top 5 favorite ways to implement Cairngorm features in a Flash Application built with Flex many including elements from the UM Extensions.

So, without further delay...

5. The AnnounceFaultEvent

Error handling can often be an overlooked item when building a Flex application. The AnnounceFaultEvent class in the UM Cairngorm Extensions provides a nice way to generically handle faults. In fact, the UM implementation of Command has built-in support for the AnnounceFaultEvent. If a FaultEvent is passed to the fault method of the Command (via the IResponder interface), an AnnounceFaultEvent is automatically dispatched through the FrontController.

In a standard Cairngorm implementation a Command instantiates a Delegate and invokes a method on that Delegate to perform the action that the Command is responsible for. Typically, the Delegate will inform the Command that either a result returned form the operation or a fault returned from the operation. Because Flex is based on asynchronous communication the Command's call to the Delegate cannot be blocking (ie wait for a response). So, we need a way to signal to the Command that the operation has finished and deliver the result (or fault) of the operation. The common way to accomplish this task is using the Responder pattern. A Responder is a class of object that has both a result and a fault method. The idea is that a caller maintains a reference to the Responder instantiation, and the callee notifies the caller via this object. In the UM Extensions, the Command class will automatically fire an AnnounceFaultEvent when a Delegate passes back a FaultEvent to the Command.

Here's the example:




AnnounceFaultEventExampleApplication dispatches a AnnounceFaultEventExampleEvent

AnnounceFaultEventExampleEvent is handled by CairngormTipsFrontController

CairngormTipsFrontController instantiates AnnounceFaultEventExampleCommand

AnnounceFaultEventExampleCommand calls exampleOperation on AnnounceFaultEventExampleDelegate

AnnounceFaultEventExampleDelegate responds with a FaultEvent

The FaultEvent is handled by FaultCommand



Tip #4: The EventGenerator is coming soon... It's out now