Category Archives: Flex

Trafikanten real time data on desktop and mobile

maajegloepeMaking Waves recently released two totally free services for the citizens of Oslo, Norway. Trafikanten (trafikanten.no) delivers real time data on the public transport in Oslo and through development in Flex and Flash we have created two applications that help the citizens to get quick access to this data.

The desktop version is created in Flex with an AIR application as outcome, while the mobile version was based on Flash Lite 2.0 and developed using Flash. Both applications are based on the same design and both applications use Shared Objects to save the users favorite public transport lines. Part from that there are two very different solutions. Both solutions were developed within a timeframe of 70 hours!

Read more at http://mjl.makingwaves.no/

The main challenge when developing Flash content for mobile is to develop on a version that most available phones support. We decided to develop for Flash Lite 2.0 even though we lose a lot of today’s phones. But even phones with Flash Lite support have different specifications and it’s a jungle to find out which phone that supports which commands and so forth… but it is possible J

But the biggest issue with this application was loading XML. Flash Lite 2.x solutions are not very friendly to xml loading. It fills up the phones memory in no time. So the biggest lesson learned is to find workarounds if the first thinkable solution is to load xml data into the mobile phone. Part from that, developing applications for mobile phones is no walk in the park, but it’s really cool and not to hard either ;)

Also posted in AIR, Front-end, Mobile | 2 Comments

Everybody is talking about the weather

The summer is over and this summer’s weather is on everybody tongue. Especially in Norway everybody is talking about the weather…

With that in mind I have created a little showcase of a small AIR application. The application collects weather info from yr.no and is limited to showing the weather in Norway (for now). You are able to search for locations in Norway and get the weather forecast for that location. Using SharedObjects you can also save your favorite locations and set your startup location. The forecast is updated every hour so you always can keep up to date to how the weather will be on your location :)

Try it out by installing from http://www.svenway.com/applications/weather/

The application is created in Flex based on a simple Cairngorm architecture.

Also posted in AIR, Front-end, RIA | Leave a comment

…but Director wasn't dead!

Everybody has written Director off for the past two years. “It’s dead and buried” we’ve been chanting. Well then, prepare for a miracle, because Director has arissen from the dead and has just been re-launched in a version 11.

Features include support for all known and unknown media formats (videos, images and audio), a brand new 3D engine with physics subsets, Lingo is “gone” and replaced with JavaScript as main scripting language, text-renderer, a brand new interface and of course a vast selection of new Xtras (plugins).

Director 11 is not a competitor to Flash due to the lower penetration of the ShockWave plugin (4,5 MB). However, it sails ut as a competitor to AIR, and a serious one as many of the new Xtras are certified with Vista and OSX. Many of the new Xtras have capabilities far beyond the AIR environment.

Adobe is pinpointing the game-industry as well as the traditional video and e-learning markets with this new release. Personally I see it as an actor on the application-market for specialized task-applications as well.

Check it out here.

Also posted in AIR, Flash, Front-end, RIA | Leave a comment

Tamarin

At the moment Adobe is lending both manpower and knowledgde to the open-source project called Tamarin. Tamarin is an attempt of creating a new OO-based JavaScript 2.0 standard up and running. Since both JS2.0 and Actionscript will be based on the ECMA-262-v4 standard it’s easy to understands Adobe’s “goodwill” regarding this project. (Erh… future incorporation of whole or part of Flash Player (AVM2) into browsers, for instance)
However, Tamarin is a joint venture by Mozilla, Adobe, Microsoft, Apple, Opera etc and will likely pass as the future standard for the long awaited JS2.0 standard. Tamarin will be licenced under GPL, which means free use without modification.

Tamarin will be deployed in Firefox and SpiderMonkey as of autumn 2008, and the rest will follow.

Further reading: Tamarin FAQ

T:)

Also posted in Flash, Front-end | Leave a comment

Some useful RIA links

I believe that those links are worth mentioning, RIA & Flex communities:

Some other very interesting links:

I believe that list of other links, strongly related to the Flex and Actionscript 3, will be also helpful. Please, give me some time to choose some from my bookmarks :)

Also posted in AIR, Flash, Front-end, RIA, Silverlight | 1 Comment

Cairngorm vs. Pure-MVC – some thoughts

Very nice intro to microarchitechtures, Wojciech, and I believe a correct assumption that Cairngorm is the one to choose.

However I want to advocate the use of PureMVC. I tried to use a “semi-Cairngorm” approach on my latest project and having only mediocre knowledge of how Cairngorm works it took me too much time to wrap my head around it entirely. Maybe it’ll help if you could publish a hands on example made in Cairngorm.
I have now tried to make an ideal small-app in Pure-MVC and I find the concept of MVC-Facade much easier to grasp than the MVC-Service logic (This of course since I know the Facade pattern better ;) ) I like the strict use of mediators and proxies, the way you kind of information-hide all the VO/TDOs known from Cairngorm.
The main critique of pure-MVC is that the strict-typing of retun values from proxies is gone, all you get is generic objects. This is a big flaw since you loose the ability ty type-check return values. You’ll need to know what comes back. However  I feel the same problem is present in the Cairngorm’s VOs as well? Or am I wrong.
Pure-MVC has scheduled a new release “soon” and I am curious of what to expect. If they address the few flaws they have now it’ll sail up as the best cross-language microarchitechture to use, since Pure-MVC is now language-transparent (ie .Net-compatible and SilverLight-compatible). Cairngorm is currently bound to ActionScript (AS3).
However… the word on the net is that “if you’re gonna use a microarchitechture…use Cairngorm”, so one day soonI’m gonna make an effort and use it :)

Also posted in AIR, Front-end | Leave a comment

Flex Architecture Frameworks

Why bother to use frameworks?

I believe that Flex it is more than name, it describe the environment itself. It’s friendly for developers, flexible to maintain changes, new requests and functionalities, design changes and improvements. It is also very extensible. We can create, share and use hundreds of libraries, components or frameworks.

Flex projects are meant to be internet RIAs, big loads of code created to be fulfilled with very interactive functionalities. With Flex we can deliver products which bring new quality to the Internet sites. Developing those applications usually require couple of visual components, some Web Services connections and adding some Actionscript to tie everything up and here we go! We’ve got RIA. Results tend to be amazing comparing to small amount of effort.

That’s one of today’s software development features. Develop rapidly.

But what happens when we are facing functionality changes, interface improvements, changing Web Service to AMF? Need of adding new module? What if we are given with new developer into existing project? Well… It depends on how much effort did we make to write an application, but usually it is the same. Nightmare :)

So why bother to use architecture framework? Why need to learn couple of more approaches which on the first look scares everyone with complicity?

  • Because we got a free ride to well organized application and we can focus on developing amazing stuff rather than thinking of complexity of the architecture.
  • Because we don’t want to spend another days thinking how make last five client’s changes.
  • Because we can develop the most important parts in the same way while we can focus on launching interaction into outer space :)

Well organized app?

I believe that some of the most important strengths of well organized architecture of application should:

  • isolate parts of application, visual components from communication, events, model that store data and actions – for simplicity and clarity,
  • keep the interface and model code simple as possible – since they are the most adjusted part of the application,
  • be able to resist frequent or unpredictable changes while maintaining the same, high level of quality,
  • make it easy to test and develop occurring bugs,
  • be easy while developing independently of the others,
  • make it possible programming tasks parallel so can be carried by different people,
  • provide a very high user experience with clear feedback and lack of latency.

Two words can cross your mind while reading those points: Isolation and Encapsulation. They are foundation for most of the frameworks, specially based on MVC architecture.

Two words regarding to MVC

Ok, not only MVC, but rather MVCS, as they are most popular in Flex enviroment. We are speaking about “Model-View-Controller-Service” approach.

  • Model (or State) – its objects are what the application knows, information about world modeled by our code. When it changes, using events it informs View to update user interface.
  • View (or Presentation, or Presentation and Interaction) – View objects are the interactive and graphic surface of the builded application. It presents information to the use, and respond to her/his interaction by invoking actions in the Controller.
  • Controller (or Action) – it implements what the application does, modifying model, invoking services to communicate the world outside.
  • Service (or Communication) – Service objects are how the application talks to the world outside, it populate objects of the Model using information collected from others :)

For people who see this for the very first time it’s more than abstraction. But believe me, it’s more simply than it looks like.

Flex dedicated architecture frameworks

Ok, coming back to the story line – I had tried and worked with some frameworks for Flex. Knowing each of them is connected with need to learn some design patterns, sometimes more advanced, but that’s another story. Generally, worth of mentioning are some of frameworks.

How evaluate effectiveness and quality of the framework? I believe that those are important:

  • approach – documentation, adoption, community & shared knowledge,
  • scalability – testable code, encapsulation, changeable, parallel development, modularity,
  • flexibility – open source license, internal & external dependencies (like .NET, Java etc.).

Adobe Cairngorm
http://labs.adobe.com/wiki/index.php/Cairngorm
My favorite. Developed and maintaned officialy by Adobe while having very big community. Well documented, open sourced, based on best patterns taken from Java and .NET and very extensible.

Using Adobe words:

“The Cairngorm Microarchitecture is a lightweight yet prescriptive framework for rich Internet application (RIA) development.

Cairngorm is an implementation of design patterns that the consultants at Adobe Consulting have successfully taken from enterprise software development (with technologies including J2EE and .NET) and applied rich Internet application development using Adobe Flex.”

Biggest project created in Making Waves with Adobe Cairngorm so far is Vattenfall Energy Calculator. Project had to be changed couple of times during development, we had pretty big model and communication. Cairngorm passed tests for A+

Cairngorm Diagram

PureMVC
http://puremvc.org/
Cairngorm’s best competitor. While Cairngorm is made only for Flex, PureMVC is Actionscript framework that can be used with Flash, Flex or pure Actionscript code. It has very clean implementation and is well documented. Cliff Hall, founder of the PureMVC states that this framework solves many problems that can be found while using Cairngorm framework. I believe – depends on what are you looking for :)

In Cliff Hall’s words:

“ PureMVC is a lightweight framework for creating applications in ActionScript 3, based upon the classic Model-View-Controller design meta-pattern.

This free, open source framework does not depend on any Flash, Flex or Apollo classes, and is therefore suitable for architecting applications on any platform running AS3.”

Sometimes it turns out that this dependency is advantage.

PureMVC

Model-Glue: Flex
http://www.model-glue.com/flex.cfm
Model-Glue is framework based on MVC. First it was ported to ColdFusion and Java. Framework itself is interesting, but lacks documentation and some approaches appears to be immature. In their words:

“Model-Glue: Flex brings implicit invocation, Model-View-Controller design, and cleaner, less repetitive integration with backend services to Flex 2.0 and AIR applications.”

Flest Framework
http://code.google.com/p/flest/

“Flest is an ActionScript3 / Flex application framework for building enterprise level RIAs. It uses such design pattern as Controller, Factory, Command, etc. High efficiency, simplicity and practicality were set as its mandatory design features.”

Although the framework operates with Model, Controller, Command and view State, should not be considered as MVC implementation due to keeping Model and View together and representing Commands as closures, functions that can run in a context of given object.

In my opinion this framework lack of documentation and implementation details are not so encouraging.

YOUR-OWN Framework
Well, actually there is no need for using any of those. If you are developing yourself or you have relatively big experience and code with someone on the same level – you can try to use this solution. However I strongly suggest deep understanding of MVCS and proven design patterns. Keep in mind that introducing someone new to your project might take a lot of time.


Conclusion

There are many more frameworks, I wanted to focus on the main ones. Using architecture framework help our own work. We can make them more stable, flexible, modularized and able to be developed parallel without any misunderstandings between developers. I strongly recommend Cairngorm as our main framework, due to many of its benefits. I hope that you have enjoyed this small introduction to Flex frameworks and I will be able to write some introduction to Adobe Cairngorm soon.

See your comments in my code,
Wojciech Ptak,
RIA consultant & Flex developer
Making Waves

Also posted in Front-end | Tagged , , , , , , | Leave a comment