My FLEX Journey

Apr 5, 2009

I started this journey a month back or so and here is how it was and how it is now.



 Back Ground
 I am working on developing web Enterprise applications using Java J2EE technologies for last 10 years. All the time my biggest complaint was why do I need to write everything by myself i.e. HTML (first design the page) then use some framework like Struts Spring as MVC and other stuff. Before I came in to Java I was a Visual Basic developer and it was cool in developing desktop applications by just dragging and dropping and defining the events. My biggest belief is as an Application Developer I should be worrying about my business logic and rest should be taken care by framework or technology. This is exactly what J2EE addressed on Server side when it was released i.e. it takes care of Deployment, Resource Management, Connection pooling, Transaction Management etc and I just need to work on my business logic.

FLEX

Flex seems to be addressed some of these very well on the client side i.e. provide a working area where we can just drop existing components and start defining what they do and how they do. We can also reuse some of the custom components. I feel learning Flex is little bit steep in the beginning especially for someone like me, who has not worked on even driven applications for a long time. I started my first Flex screen by just looking at some of the examples from Adobe @ http://livedocs.adobe.com/flex/3/html/index.html and luckily this screen was simple one with no Commits to database i.e. just read from Database and display on the screen. I have used XML communication between Flex and Java deployed as a WAR project on JBoss application server. This worked perfectly fine for my screen requirement. During this screen development I was spending most of time on Google and Adobe in searching how to construct XML on the server and also how to read it in Flex and also how to display collections in a drop down, Grid. First screen gave me some opportunity to learn how Flex works and also experiment different layouts, containers, components and also some Action Script.

After I finished this screen I have to work on my 2nd screen which is more complex to me with 2 dropdowns, Tree component, editing tree nodes, screen modes (view, edit) and many more. I thought I can never finish this screen looking at my limited flex knowledge and also screen complexity. But as an applications Architect I had to approach it organized and iteratively and this worked (working) perfectly to me. I am still working on this screen and so far I do not have any road blocks.



Flex Learning Resources:
A simple Getting Started    http://learn.adobe.com/wiki/display/Flex/E4X

Adobe Resource Center    http://livedocs.adobe.com/flex/3/html/index.html

 Flex in a week from Adobe    http://www.adobe.com/devnet/flex/videotraining/

Flex Learning Path – Programmer    http://www.adobe.com/devnet/flex/learn/programmer/

A must to have AIR for every Flex newbie “Tour de Flex Component Explorer”    

http://www.adobe.com/devnet/flex/tourdeflex/


XML over HTTP (or) Remoting using AMF

XML seems to be tempting and easier approach when you are beginning with Flex but as the application gets complex XML seems to be painful. First thing is we need to do 2 time XML parsing i.e. one on server and one on client and 2nd thing how do we manage XML when we need to do some heavy CUD operations? I ran in to this issue when I started my 2nd screen which has lot of CRUD operations and immediately I started looking out for some alternatives to this XML. First thing I ran in to is ‘BlazeDS’ from Adobe which seems to be addressing ‘Remoting’ perfectly for my needs. Also Adobe claims (I have also seen someone posted these performance numbers on web) that it is faster using AMF (Action Message Format) comparing to XML communication. Learning BlazeDS is easy and straight forward for any Java Developer (May be I will write another post on BlazeDS). There are other alternative to BlazeDS like GraniteDS and other claiming that they are better than BlazeDS but I will experiment with them once I get comfortable with all these new technologies (to me).


Flex MVC Framework (Cairngorm)

Currently 80% of my UI and Action Script code are on same MXML file and this is growing day by day and I started hating my code. Next question is how I refactor this code to put it in a nice MVC style framework. Cairngorm seems to be a nice one for a starter like me. I experimented with it yesterday only and also I have applied it to my 2nd screen and most of it is simple and easy but I hit a road-block in it i.e. how do I enable disable UI components based on events and their response (result fault). I will look in to it more in next couple of days (May be another post on Cairngorm). There are other frameworks like PureMVC, Swiz and Mate. I hear lot of good about Mate and this will be the next in my list to experiment.


Maven2

I hate Ant and a big fan of Maven even though it has some drawbacks. But I can be up and running with Maven in 5-10 minutes for any project. Flex do not have good support for Maven and this was the task I have spent overall a week or so (bad part is I have started on it before I started on developing Flex so I did not had any idea about what is SWC, SWF, RSL etc). There is an open source project called “flex-mojos’ lead by Marvin Froeder (Velo) and it is the best plug-in available for Flex-Maven. Please look at Google groups http://groups.google.com/group/flex-mojos for further details also here is the latest wiki for it @ https://docs.sonatype.org/

As always drop me a message for any questions or suggestions….

No TweetBacks yet. (Be the first to Tweet this post)
Share and Enjoy:
  • del.icio.us
  • TwitThis
  • LinkedIn
  • StumbleUpon
  • Facebook
  • Google
Posted by Srinivas Kusunam | Categories: Flex |

Share with others

4 Responses so far | Have Your Say!

  1. Zoran
    April 20th, 2009 at 10:45 am #

    Ugh, I liked! So clear and positively.

  2. Srinivas Kusunam
    April 20th, 2009 at 12:09 pm #

    Zoran i am glad you liked it :)

  3. How I Lost Thirty Pounds in Thirty Days
    May 4th, 2009 at 12:46 am #

    Hi, good post. I have been thinking about this issue,so thanks for sharing. I’ll definitely be subscribing to your site.

  4. mcdonalds free coupons
    September 14th, 2009 at 6:53 am #

    Thanks much for that great entry.

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>