Archive for the ‘Articles’ Category
AMF Playground with public services, Flash/Flex client-server communication
Today I published a microsite (http://amf.riaspace.com/) on my blog dedicated to AMF communication. The goal of it is to gather necessary information needed for quick start with AMF.
You will find there:
- Publicly available AMF services for the start without setting up your own server environment
- Code snippets demonstrating how to utilize AMF services
- Video tutorials on how to setup your own Flex/Zend_Amf projects
- Demo applications with a source code
At the moment I’m hosting only PHP based services but I’m also thinking about Java based backend to be able to play with messaging.
Configuring Eclipse PDT and Flash Builder 4 Plug-in for PHP/Flex development
In this tutorial I will explain how to configure a development environment to work with PHP and Flex projects in one tool. In order to do that I will use Eclipse PDT 2.1 (PHP Eclipse plugin), Flash Builder 4 Plug-in Beta 2 and the latest Eclipse IDE for Java EE Developers package, which is eclipse-jee-galileo-SR1-macosx-carbon (of course if you are on Windows you should get the proper Windows version instead) at the moment. Additionally I will use MAMP (Mac, Apache, MySQL, PHP stack), of course there are other possible solutions like WampServer for Windows, multiplatform XAMPP, or Zend Server.
Download links:
- Eclipse IDE for Java EE Developers – http://www.eclipse.org/downloads/
- Eclipse PDT 2.1 (pdt-Update-2.1.2.zip) – http://www.eclipse.org/pdt/downloads/
- Java SE Development Kit (JDK 6 Update 17 – at the moment) – http://java.sun.com/javase/downloads/index.jsp
- Flash Builder 4 Plug-in Beta 2 – https://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_flashbuilder4 (you need to login with a free Adobe ID account)
- ZendDebugger (download latest version depending your operating system) – http://downloads.zend.com/pdt/server-debugger/
- MAMP, WAMP, XAMPP, or Zend Server
http://www.mamp.info/
http://www.wampserver.com/
http://www.apachefriends.org/en/xampp.html
http://www.zend.com/en/products/server-ce/
Installation steps:
Step 1) Start with Eclipse IDE for Java EE Developers installation, it is as simple as unpacking it to some folder on your drive. If you are on Windows make sure you have the JDK (Java Development Kit) installed on your system. Without that Eclipse will not run.
Step 2) Run Eclipse from the folder you installed it in. A clean installation will start with welcome screen; select Workbench option in the right upper corner to go directly to the development environment.
Step 3) Install PDT 2.1 as described in the following section of the PDT installation wiki: http://wiki.eclipse.org/PDT/Installation#Eclipse_3.5_.2F_Galileo_.2F_PDT_2.1
IMPORTANT DON’T INSTALL PDT 2.2 AT THE MOMENT as it has some bugs that are causing PHP scripts to crash. Go to the link at the top and download one marked on a picture below (pdt-Update.2.1.2.zip):

As described in the wiki link above, in Eclipse go to Help > Install New Software… > Add… > Name: PDT, Location: jar:file:/path/to/pdt-Update-2.1.2.zip!/

Step 4) Install Flash Builder 4 Plug-in Beta 2 pointing to the Eclipse installation that was unpacked earlier, as shown below:
Step 5) Now you are ready to run your PHP/Flex development environment. Just remember NOT TO run it with the links provided by the Flash Builder 4 Plug-in installation. IMPORTANT: Directly start Eclipse from the folder you unpacked it into.
You can switch to the PHP or Flash perspective in upper right corner of your Eclipse Workbench by selecting it from the list in the Other option.

Step 6) Install the Apache, MySQL, PHP stack. Unpack ZendDebugger downloaded from one of the links above. Follow the instructions in README file to install it on your system.
Alternatively you can use ZendExtensionManager and configure it this way in your php.ini file:
zend_extension_manager.debug_server=/Applications/MAMP/bin/php5/zend/lib/ZendDebugger-5.2.15
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
IMPORTANT: ZendDebugger-5.2.15 is the unzipped ZendDebugger package and its subfolders need to be renamed to follow this schema: php-5.2.x. For example: 5_2_x_comp => php-5.2.x
Just remember to drop dummy.php into your website public root folder on your dev environment.
Step 7) Create your PHP project and give it a Flex Project nature by right clicking on your PHP project and selecting option Add/Change Project Type > Add Flex Project Type. This way you can have all your code in one single project. Of course you can have two separate projects for PHP and Flex but this is your decision. Do what will be more convenient for you.

And now you can Rock & Roll with PHP and Flex!
e-Government RIA manifesto
Last week I was presenting at MAX 2009 in LA where I talked about Flex and Adobe AIR in Government, it was based on e-Deklaracje Desktop application released by Polish Ministry of Finance (you can find more info about e-Deklaracje Desktop in one of my previous posts here). Important here is to note that e-Deklaracje received Honorable Mention in Adobe 2009 MAX Awards. My presentation was focusing on requirements, challenges and solutions that Ministry of Finance faced during implementation of e-Deklaracje. Here is the link to video of my presentation online. At the end I concluded with my personal manifesto that I believe e-Government Rich Internet Applications should be guided by to achieve success! Manifesto is made of four mandatory bullets that are in totally random order but each as equal in its value:
Consistency – application should work consistently on all major operating systems, browsers or even hardware without compromises. Citizens should have freedom of using different environments and achieve same user experience.
Openness – the architecture of the application should be open and available to the public. Preferably it should use communication channels and formats based on open standards e.g. HTTP, SOAP, AMF or JASON. These commodities will make integration and extensions easier for the public.
Experience – citizens’ experience should be as straightforward as possible and that applies to anything like usage, accessibility or installation procedures. Actually experience should engage and drive the user through the application.
Security – this is the most obvious one but shouldn’t be forgotten. User data should be secure not only on server side or over communication channels but also on the client side. Encryption to storage or access should be applied where possible, giving the user confidence while using the application.
Any comments are most likely welcome. RIA is trend now that whole industry is going towards and as citizens and users of e-Government applications we should expect same from public institutions solutions.
Interview with me in Belorussian “Computer News”
Last week Belorussian “Computer News” newspaper has published interview with me, here is the electronic version: http://kv.by/index2009354301.htm I encourage anyone to read, especially if you know Russian
– sorry for the mistake in the beginning with Belorussian
Adobe AIR in government institutions (e-Deklaracje Desktop)
At the beginning of April (09.04.2009) Polish Ministry of Finance released their first Adobe AIR based application e-Deklaracje Desktop. This application lets its users submit annual tax declarations electronically and monitor their status. In Polish tax legislation every citizen is obliged to settle his income for previous year with tax office by the end of April. Historically e-Deklaracje project was initiated by Ministry of Finance in 2007/2008 but with less success and wide range adoption due to electronic signature requirement. By that time it required special hardware readers for digital signatures that are not commonly adopted in Poland.
This year Ministry of Finance has prepared change in legislation that was later signed by President of Republic of Poland that allowed sending annual declarations without qualified digital signature. Still to ensure proper security level users had to provide their personal information like: first name, last name, date of birth, NIP – tax identification number, PESEL – personal identification number and declared income from previous year. In reality this set of information is more than it was required in traditional paper based declarations (that’s the case with income from last year). I guess all this information gives better identity verification than traditional way where anyone can send his declaration by post or bring it in person to tax office (where no one asks for any id).
After only three weeks of availability over 77000 citizens have sent their declarations electronically (UPDATE 18.05: latest information from MF website states that 89000 declarations were sent, I guess those that forgot to do it till the end of April are still submitting)!!! This is incredible result taking into consideration such a short time, I believe next year we can expect this number to multiply couple times when people will have it available since January.
I’m also proud to say that local Adobe team (Tadeusz Chełkowski, Tomasz Lichota, Bartek Soin and of course myself) supported this project from very beginning with our technical and RIA experties.
Why Adobe AIR?
Ministry of Finance had couple of major requirements that had to be met by that type of application:
- Cross-platform support – solution had to work without any compromises on all major operating systems like: Windows, Mac OS X and Linux.
- Usability – it had to be easy to install and natural to use for inexperienced users. With badge installer on MF website it just couldn’t be made easier.
- Security – give the users confidence that application they are installing was really issued by Ministry of Finance.
- Interoperability – integration with SOAP based backend services.
- PDF forms support – already existing PDF forms developed in previous year could be reused with small adjustments supporting non-qualified signature.
- Desktop integration – required desktop features:
- Reliable local storage for drafts and sent declarations offline persistence;
- PDF forms templates and documentation local caching;
- Notifications mechanism for asynchronous confirmations (declarations receiving and confirmations service works in asynchronous mode with response time up to 24 hours).
As you can see all of above make Adobe AIR perfect fit for that type of applications. In my opinion the most important features in case of any application issued by public sector institutions are: cross-platform support, usability and security.
We had some stories in Poland in the past of applications written only for Windows platform with closed protocol specifications that ended with Linux users taking legal actions against publishing institutions. Adobe AIR built-in cross-platform support resolves this issue, I actually observed very positive feedback especially on Linux forums after e-Deklaracje release. Some comments stated that this is first time Polish government institution has noticed that there are also other OS’s than Windows.
In terms of usability there are two important factors, first of all installation process to make it as smooth as possible, ideally with small footprint, dependent runtime, tools and libraries automatic detection and installation (badge installer was resolving most of these, except Adobe Reader installation). Another factor is availability of experienced UI designers and developers. This is Adobe’s strong field with great community of Flash and UI design experts.
From the security perspective for application that gathers and sends out user personal information is important to give users confidence that the application was distributed by trusted entity and any communication with backed services is done through secure encrypted channels. Application issuer verification is Adobe AIR built-in feature with signed install packages.
You can check it out yourself on MF website: http://www.e-deklaracje.gov.pl/index.php?page=do_pobrania
This is how the application looks:
e-Deklaracje Desktop main window
Declaration fill window
History window
Flex with full Zend Framework on Adobe Developer Connection (part 2)
It was actually published last week but I just found some time to write about it on my blog. Its a part 2 of my ADC series about Zend Framework for Flex developers:
Recording is also available directly on Adobe TV website and iTunes.
Encoding options for H.264 video
Anyone interested in video encoding stuff and especially in H.264 should check out new article on ADC: http://www.adobe.com/devnet/flashmediaserver/articles/h264_encoding.html
Flex Developer Tools – MVC & DI Frameworks
I was recently sidetracked by some other activities but I’m back with my research on Flex Developer Tools. Today I wanted to share couple of my findings in MVC & DI (Dependency Injection) frameworks area. Again I’m looking for your feedback with experiences and maybe missing things. As you can see we have 100% Open Source products here. I guess this is similar to testing, mocking and code coverage stuff.
- Cairngorm (Adobe Open Source) – Its a very powerful MVC framework that comes from Adobe, a lot of Adobe Flex/AIR based products especially those built by Adobe Consulting are using this one.
- PureMVC (Open Source) – MVC framework, very famous in this league, interesting that they even ported that to Objective C for iPhone development – cool!!! So now we Flex devs should have easier live there
- Mate (Open Source) – Mate is a tag-based, event-driven Flex framework
- Swiz (Open Source) – Metadata-based Dependency Injection framework, this is my winner, I really love it. In some way it reminds me of Seam Framework from Java/JBoss camp. With simple metadata annotations you can inject your controllers, components, config items etc. It has also metadata driven eventing capabilities, you can annotate event handler methods. Couple of other neat features like command chaining, slick RemoteObject delegate handling…
- Spring ActionScript (Open Source) – DI framework part of SpringSource ,formerly known as Prana Framework. Very much like Spring but for Flex, similar configuration and approach. I think it is a very interesting and worth giving it a test drive…
Here are the link to my previous posts in Flex Developer Tools series:
How-to use Text Layout Framework
Some time ago I was writing about how-to use latest Text Layout Framework but this time Mihai Corlan did excellent job and went down into very details, any one interested in TLF should read this one: http://corlan.org/2009/01/19/how-to-use-text-layout-framework-in-flex-32-or-air-15/
Flex Developer Tools – Testing, Mocking and Code Coverage
This is next post of the “Flex Developer Tools” series, this time I’m covering Testing, Mocking and Code Coverage. In this category the winner is Open Source
as opposed to IDE category where we have more commercial tools. Again I would like to hear what are your thoughts and experience with these tools, frameworks and libraries.
- FlexUnit (Adobe Open Source) – conceptually based on famous JUnit
- Funit (Open Source) – Metadata Driven Unit Testing for Flex
- asUnit (Open Source) – Unit Testing Framework
- fluint (Open Source) – I never had a chance to use this one but it seems to be very impressing and I’m looking forward to give it a try in my next project. “It provides full support for unit testing in the tradition of FlexUnit, but goes further with richer asynchronous support and support for integration-level testing.”
- FunFX (Open Source) – Cool: “A Ruby tool for functional testing of Adobe Flex applications“
- FlexMonkey (Open Source) – UI testing, capture replay
- Selenium (Open Source) – API for Selenium
- FlashSelenium (Open Source) – Selenium RC Client driver extension
- HP QuickTest Professional (Commercial License) - According to Wikipedia: ” is an automated functional Graphical User Interface (GUI) testing tool created by the HP“. You can also find useful information how to test Flex apps with QTP in Adobe LiveDocs: http://livedocs.adobe.com/flex/3/testing_with_QTP_flex3.pdf
- mock-as3 (Open Source) – mock object library
- FlexCover (Open Source) – code coverage



