A Flex / Flash guy learning more about Java
Understanding more about Java is great. A good amount of knowledge can be shared between Flex/ActionScript 3.0 and Java. I’ve worked with Java in the past, compiled some applications, read the tutorials and some books, helped build a Java based LMS and also worked with Adobe on writing a simple Java socket server, but I wanted more of a thorough understanding of the language. The University of California at San Diego offers a great series of programming and software development courses. These classes are really affordable so I decided to take a Java II course. It’s been seven weeks and so far the experience has been awesome. The end goal is to become more familiar with the core Java language. My hope is that this will enable me to have greater confidence when working on Flex and BlazeDS projects. (A really cool stack I’ve been playing with recently is Flex/Cairngorm, the new Spring/BlazeDS integration and Hibernate/MySQL. Eventually I want to get this running on Glassfish. Something else I’ve been looking into.)
Some items we’ve covered in the Java class so far are: SDK installation and command line compilation, data types, control flow, variables/operators, numbers, arrays, objects and classes, static classes and methods, method overloading, object construction, constructor overloading, OOP basics, packages, commenting, generating JavaDoc, inheritance, abstract classes, polymorphism, sub/superclasses, reflection, inner classes, graphics programming, event handling, Swing and Collections including Maps, Lists, Sets and the Comparator interface. We’re compiling all of our homework using the command line. It’s pretty cool. The class also demands a pretty rigorous reading schedule. The three-pronged-learning-approach is working well for me: lectures, reading, coding (homework and labs.) The ins and outs of the language are really sinking in.
A few immediate benefits to learning more about Java are: Flex and BlazeDS / LCDS integration, strengthen fundamental OOP understanding and comprehension and also gain knowledge of OOP concepts not available in Flex/AS3. Learning Java also provides the opportunity to get exposure to Swing (Flex’s distant relative). Also, since the Flex compiler and other aspects of the Flex SDK are written in Java this opens up the door to greater understanding of the Flex SDK and even bug contributions. Java makes extensive use of design patterns and there is a plethora of existing Java code to look at, use and learn from. (Cairngorm was born from J2EE design patterns.)
There are several differences that I noticed in Java. Some items available in Java and not in AS3: static classes, abstract classes, private constructors, constructor overloading, method overloading and Collections. Working with Arrays is a LOT different, working with numbers is different, working with Strings is different and String comparison is different. There are no Hashmaps and no hashcodes in ActionScript. No equals() method. Another difference is that you have to implement your own design patterns more often in Java. Not a bad thing, and good to know how to do, but Flex takes care of a lot of things behind the scenes: events, data binding etc. I noticed that when coding Java the developer is expected to implement interfaces more often than in Flex/AS3. This is pretty cool; it involves more work but provides more power.
It’s been a cool experience and I wanted to share some of these thoughts and observations. I think more developers come into the Flex world from Java vs. the other way around. For some reason Java sort of reminds me of AS2… I may try to post some Java source code soon if time permits…
flickr
brightkite
I was expecting this post, coz am following your tweets which clearly points your newly born interest in Java
just kidding.
I am pure Flash/Flex guy, so am expecting some kick start from your blogs on java front. Specially do not forget to blog some basic DB oriented articles sooner or later.
Best of luck
Anand
Hello,
Its pretty fun, I just found your post while doing some research to go the other way around. I’m a java developer looking to learn more about Flex and AS. It’s been a while that I wanted to, but now I really started playing around with mxml/as. I think it’ll take some time to grasp the way as works and the differences with the language I’m familiar with, but as you pointed out, it’s interesting to see both sides.
@Anand Ha! Cool man. I will try to post some Java stuff soon.
@Sébastie Right on! Yeah I don’t know which would be more difficult really. Learning Flex or learning Java. They are both really awesome, but different for sure.
Thanks for checking the blog guys. Hope all is well.
Kind regards,
Sean
[...] own open source offering: BlazeDS. Successful reports include Ries at BMK LLC, Igor Costa and Sean. Also see Ryan’s comments in this TA post. The most complete series is by Anachronymous: [...]
[...] for a while. I also want to learn more about how data synchronization works between AIR and LCDS. I learned quite a bit more about Java in 2009 (got an A+ in that class btw) to help with learning more about BlazeDS and imagine that will help [...]