Flex as seen through Java’s eyes

                       fx_icon_special_100x100

                                              duke-thinking1

On April 14th, the San Francisco Java User’s group had their monthly meetup at Google, San Francisco. Walt Schlender , a Flex enthusiast and Chet Haase, Flex scientist from Adobe gave a great presentation on Adobe Flex and introduction to ActionScript3 from a Java developer’s perspective. As a Flex noob, this talk has raised my general interest in AS3 and Rich Internet Applications in general. I would like to highlight some features in Adobe’s Client side platform Flex from the presentation, in comparison with Java.
Variable declaration in –

            Java : private String s = “Java”;

            Flex : private var s:String = “Java”; (by the way semicolon is optional in Flex! So your compiler does not moan at the missing semicolon any more)

Function declaration in –

            Java : public boolean sampleFunc(String s){ …. }

            Flex : public function sampleFunc(s:String):Boolean { …. }

Packages in –

            Java :

                package foo;
                class FooThing {
                     .........
                }

             In Flex , the package has enclosing brackets over the entire package body :

                package foo{
		    class FooThing {
                      .........
		     }
                }
  • Flex has a concept of undefined for variables which is not present in Java, but Undefined != null. AS3 has “undefined”, “null”, and “NaN” concepts.
  • Java has final has the keyword final, but Flex has “const” instead of “final” ( That makes it easier to remember). And Flex does not have private or protected constructors, all of them are public.
  • At the compiler level, Java compiles just the source code into the binaries. But in Flex, the source code along with the Flex libraries used by the source code are both compiled.

I will leave the detailed article to explain more about the differences. It is worthwhile read for an introduction to ActionScript3.

duke-chalkboard1
JavaWorld Presentation on AS3 Part 1

JavaWorld Presentation on AS3 Part 2

Overall Flex is Adobe’s trump card in the RIA game. The RIA apps you can build with Flex is FTW ! Check this Online dice application Walt Schlender has written, it is nice one. It has the simple source code in the presentation, which is easy to try. If you do not have Flex , here is  60 day free Flex trial.

Java has been the most extensively used language for back-end / enterprise applications. Adobe Flex enables developers to create highly interactive interfaces for web and desktop applications. A marriage between the two technologies means a lot to the Software world.

Java EE and Flex: A compelling combination

One most important question that nobody liked to answer was , Is JavaFx better than Flex ? 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s