Monday, December 21, 2009

Merry Christmas

Dear Readers

I wish you and your beloved ones a merry christmas and a happy new year.
I hope 2010 will be as exciting and wonderful as 2009.

See you next year,
Ralf.

PS. My unplugged christmas greetings
http://soundcloud.com/rbokel/merry-christmas-2009

Tuesday, December 15, 2009

Browser back button vs RIA

Very often we hear, that RIA applications break the conventions that the users are accustomed to in the browser, especially the use of the back and forward button.
I wonder if people really expect that though. Aren't RIAs more like real applications than a webpage? When was the last time you missed the back button in Adobe Photoshop, MS Word or some similar app?

Also, when it comes to implementation, there are some really hairy situations. Say you have a screen with a form, the user fills in a few things and presses the back button. Your common policy is to display a alert asking the user, if she really wants to navigate away. Now imagine the user says no, what does that do to your history? The history thinks, you have been going back, while in fact you stayed on the same page.
Allthough, now that i think about it, probably i can forward the history to undo the back button action. Need to test that. Thanks for listening :)

Flex & Iframes - oh my

Ok, so we have this nice little Flex app, which allows the user to use the browser back button. Wohoo, usability galore! But what if we have a iframe opened to show some html on top of the Flex app and the user presses the back button. Now it gets nasty, sniff. My beautiful code needs to do something real now :)

Tuesday, December 8, 2009

FlexBuilder locale editing conflics with Java

We are working on a international project and need some international characters inside of the locale .properties files. However, whenever we edit a properties file and save it, it gets converted to ISO-8851-1, allthough the workspace is set to UTF-8.

We are using the plugin version of FB as we also need to edit Java files. I found out, that in Window/Preferences/General/ContentType the encoding for properties files is set to ISO. After some research i found, that Java needs the .properties files to be in ISO. So i think there is a conflict here. JDT wants to ensure, that properties files are in ISO, while FB needs them in UTF-8.

Our current solution is to use Notepad to edit the locale files.
In the long run it might be better though, to change the ending of the locale files to something else to avoid this conflict.

Please vote for this bug: https://bugs.adobe.com/jira/browse/FB-24683

Friday, December 4, 2009

FlexUnit extended for long method names

Today i extended FlexUnit a bit, so we can see long methodNames. When we try to follow the BDD schema "Given A When B Then C" the names can get really long. Here is one example, and it is not even the longest one.

test_WhenTransactionsAreLoaded_ThenTransactionsAreSortedByDateDescending

However, long methodNames are truncated in the right panel of FlexUnit. So your beautiful methodName ends up looking like:

test_WhenTransactionsAreLoad...

Not very helpful. So the first thing i did, was to replace the mx:Label with a mx:Text to allow for multiple lines. But to take it a little bit further, i also reformatted the methodName. Underscores are replaced by newlines and the came case text is broken up into words. So in the end it looks like this

test
When Transactions Are Loaded
Then Transactions Are Sorted By Date Descending

Much better!
Some things don't fit well in this schema though, eg single character words like "a" or interface names like ISomething. But still, the overall result is much more readable than it was before. The screenshot below shows what it looks like in FlexUnit.



Addendum:
I have added a entry to the bug base for flex unit. Please vote for it, if you want to support it: https://bugs.adobe.com/jira/browse/FXU-83

Tuesday, December 1, 2009

Micro modules anyone?

At the moment i follow this interesting blog series about modularizing applications. Also I'm playing around with FunFx and Cucumber for functional testing flex applications.
One problem with functional testing is to navigate to the view you want to test. Maybe you need to login first and click a few menu items before you get to it. What if something changes in these areas. It might break all you functional tests for a otherwise unrelated view. I think it would make sense to create applications containing this one view only, so you don't need to navigate to get there. Now what if this view was in a module of its own? This way it could be used in the tests and in the app.

I wonder if somebody has experience in building Flex apps from such micro modules, ie. Modules which contain a very small part of the application?

Profiling remoting calls

For our app i needed to measure the duration of backend calls. Luckily our delegates were all subclassing the same AbstractRemoteDelegate. So it was quite easy to add something in. What i did is to create a Responder which measures the duration of the calls and writes them to a Log. Inside the AbstractRemoteDelegate i add this responder to every call. This gives me the data. A DataGrid inside a TitleWindow is used to display the data.

In general instrumenting a application for debugging/profiling is a interesting topic. What are you using?