BlazeDS and Spring

6 January, 2009

A few days back I posted the latest addition in Spring family – Flex with Spring. Being a huge spring and flex fan, I was very excited. Now able to reuse Spring knowlege in Adobe Flex is a wonderful idea.

I faced a few challenges in using the solution and discussed the same on the spring forum

It comes out to be a common issue with the Client compilation and non-availability of channels. Luckily there are a few workarounds that will not stop you from adopting this framework.

If you want to get a god head start, you would like to read on at: http://www.gridshore.nl/2009/01/05/wow-springframework-enters-the-actionscript-and-flex-domain/. This was something that I was going to blog away muself today. Thanks for Jettro for saving me the time :)

Have fun.


Flex Best Practices

12 August, 2008

I came across this video recording of James Ward presentation on Best practices with Flex. Do take the time to go through the complete video


Handling Dates across different geographies

29 July, 2008

This is a tricky one – evaded me for a while. Synopsis of the issue:

Flex messaging (BlazeDS is what we were using) deals with dates in a very special way. The dates are transferred to/from client / server post conversion to UTC and then they get converted to what local time zone. Let me take an example: If you are running the application server (JBoss/tomcat is what we were using) in EDT timezone. Then if a client browser is running in IST time zone the dates would get converted when passed to the server from the client. If a user was to select a date July 29th say 9:00 AM IST, when this date is sent across to the server this will first converted to UTC on the client, then sent to the server across the wire. The server would then convert the time from UTC to EDT time zone. This would mean that time of 9:00 AM IST would get converted to 11:30 PM EDT (pardon me if my time conversions are a little off ~ I hope you get the point).

And this is very much documented by Adobe as “the way” of handling dates and you can not change it without changing the open source code – which i would not recommend.

So, how to solve the issue? There are some quick wins out there, but nothing a realy true fix that i came across. Following are a few links and also my assessment as to why I dont not find them the right fixes:

http://flexblog.faratasystems.com/?p=289

This solution recommends to set the server’s time zone to UTC. Also, they themselves recommend to be careful about global and local time as that can cause some issues. Basically, you can control the time on the server, but you can not control the same on the client which still leaves you with the conversion issues. The time window (as per my example) would be reduced to 5.30 hours, but that will still remain.

http://blog.shrefler.net/?p=13

Again a way to write a helper method that will convert the time on the client (Flex) from local to the UTC which would then be sent over to the server – this solution as proposed askes us to ignore the time zone completely and also needs a helper method that needs to be invoked everywhere you need to send the date back and forth. Works, but not ideal!!

What do I recommend finally?

Well, i tried overriding the serialization mechanism completely – The solution works :-) but I have no one to provide me feedback, hence I am looking for suggestions / recommendations here as well.

My need was simple – i did not want to use the time part of the date as the user had selected and hence ignored it completely. We need to do 2 simple configurations:

1. Action Script – Write an AS object that represent a date. This class should implement the flash.utils.IExternalizable interface. This class would the client representation of the date object. The two methods that should interest you are “encode” and “decode” as these are the ones that encode the date into a string and then later on decode the same back to flex object. The file in PDF form

2. Java POJO – A POJO is needed on the server to which the client (AS class) will bind to. Similar to AS, the POJO should be able to decode and encode what is being received and sent. The functions on the Java side are: parseFlexEncoding and toFlexEncoding. Also, similar to AS this class should impement the java.io.Externalizable interface. The file in PDF form

Just put these two classes in place and then use these instead of the OOTB date object and you are all set.

The solution works as I have POC ready for this both in tomcat and JBoss, but I am looking forĀ  feedback and improvements on the same.

Have fun..!


Nice trainings

28 July, 2008

I found this link that carries some good training links. Hope you all find this useful.


Flex 4 – now available for download

15 July, 2008

An anouncement for Flex 4 to be availanble for download.With beta planned in late 2008 and GA in H2 2009, this is the first release (not a milestone though). Download now. Learn more about Flex 4.


Flex and Maven – a better integration

15 July, 2008

I came across this website that calls out for Mojos for Flex. Something nice that can take the ant out.


Flex is easy to start with

11 July, 2008

I asked my nephew to use Flex instead of JSP for his college project, and here is what he has to say after a few hours of work in Flex.

woow nw im enjoying using flex… making use of containers, Accordion, TabNavigator… many more stuff, displaying things in alertboxes having nice fonts… so many options to add in a simple project!!! will work for 4-5 days on frontend then will switch to blazeDS!!!

Kudos to the Adobe team.


Flex talking to a PHP backend

9 July, 2008

I am no PHP expert and to not intend to be one, but while I was searching how to integrate Flex with different backends, i came across some tutorials that i believe would help others:


Max 2008

26 June, 2008

Max 2008 is on its way – check it out here.


Performance | Advanced DataGrid rendering

20 June, 2008

In one of my projects there were some custom needs where we wanted to display values in cell based on the data passed. This led us to write custom ItemRenderer’s. Considering that we were creating multiple instances of Containers like Canvas, Box with-in led me to thinking how would Advanced Data Grid, respond to this custom code. Upon certain tests for 100 to 10000 rows i came up with good looking results. Find them in the document.