Wednesday, July 8, 2009

Getting Started with Flex – for Newbies

Relax and enjoy working in Flex is what I would like to tell you guys. Flex is a wonderful tool for developing Rich Internet Applications with ease. Pre-requisite to learn Flex is just basic programming logics. Flex takes care of many things for you on its own.

As a Flex developer, you first need to understand its architecture. Flex has component based architecture. That means Flex will provide (or you can create your own) components, you will use these to layout your application and write business logics. In Flex, there are two ways of developing an application, MXML or/and ActionScript 3.

MXML is an xml based language developed by Macromedia before Adobe Systems acquired Macromedia. There is no official meaning for the acronym MXML, but the backronym used by some developers is “Magic eXtensible Markup Language”. MXML is primarily used to layout the application interface (which can be done in Design View of Flex builder which eventually generates MXML tags). However, MXML can also be used to write business logic or application behavior for small applications. MXML can be used in conjunction with Action Script to write complex business logic for applications. It gives an opportunity to a person with not very strong in programming background to be able to develop RIA with ease.

ActionScript is Object Oriented programming language with all the features a programming language provides. ActionScript can be used to write complex business logics for the applications. It can be mixed with MXML code or can be kept in separate files to improve maintainability. You can write your own classes, create custom components and use them in your applications.

The output of a Flex application is SWF which is targeted to Flash Player 9 or above and it runs within a browser. Flex has some effects and transitions which can be used to create cool interfaces. One can also extend and create his own effects in Flex.

Flex applications run on client side and have no direct access to database resources or other resources which are not allowed to be accessed by client applications. However, Flex applications do have a way to connect with such type server side resources with the help of Web Services or Remote Procedure Calls. You can use server side technologies such as Java, .Net to write Web Services and access them in Flex to provide dynamic data.

Application development in Flex can be done by using free open source Flex SDK or Flex Builder 3 (Flex 3 is the latest version of Flex and the next version will be called Gumbo) Software provided by Adobe. Flex Builder can help a developer accelerate application development. If you are looking forward to develop RIA in Flex, there are many nice books available along with the resources/tutorials provided on Adobe site. Some of the books you may consider are McGraw Hill’s ‘Flex 3 A Beginners Guide’ or ‘The Essential Guide to Flex 3’ by friends of ED.

Happy Learning…

1 comment: