| By Yakov Fain | Article Rating: |
|
| February 10, 2008 11:15 AM EST | Reads: |
47,584 |
Some Pragmatic Flex/Java Considerations
Cool
technologies come and go. Only some of them settle down in the toolbox
of a professional programmer working on enterprise business
applications. The technical excellence of any software is important,
but it's not the only component in its success.
The Learning Curve: Reuse of Skills and Code
One
important concern of any development manager is the availability of a
large pool of people who know a particular software. There are plenty
of Java programmers with the skills required to develop Web
applications, and the good news is that enterprise Java developers with
servlet/Java EE programming skills or Java Swing experience will find
the Flex path very easy.
Java and ActionScript 3 are very similar;
Eclipse is a familiar environment for many Java developers. Since Flex
piggybacks on Java EE and browser technologies, a server-side Java
programmer should be able to correlate his current skills with the
development process in Flex. Java Swing developers will instantly spot
similarities to Java event and layout models. In our experience, the
typical ramp-up time for motivated Java developer is two weeks. The
best part is that Flex seamlessly integrates with existing Java server
code of any flavor - POJO, EJB, Hibernate/Spring, or JMS, so the
server-side part can literally remain unchanged.
Application Security
Another
important consideration is the security of Flex/Java applications. Flex
server-side security management is quite extensive, and it lets you use
either container offerings or custom security providers via declarative
XML binding. There are a couple of challenges since Flex supports
multiple protocols, so Java EE security that relies only on HTTP
sessions has to be extended, but it's a simple and well-documented
process. On the client side, it builds on Flash Player security that's
known for its lack of serious security flaws. You have a built-in
security manager that has all the standard protection for cross-domain
and zone access. Corporations can further restrict the code they get
from third parties by wrapping the code loaders in additional security
managers.
Flex GUI Performance
Java Swing is a tried and true
tool for developing responsive GUIs in demanding applications like
stock trading and online auctions. Flex is capable of providing
near-real-time data rendering to the GUI and very high refresh rates on
large data sets. Flash Player 9 is the high-performance modern virtual
machine with precompiled optimized code and a just-in-time (JIT)
machine code compiler.
Shorter Development Cycle
It's
very possible to build the client side of a real-time portfolio display
integrated with news feeds and graphs in about 200 lines of Flex 2
code. A similar Swing program (even if it's created with commercial
IDEs) would be several times larger.
A decent Flex developer should
be able to prototype (short of server processing) most of the UI for a
specific trading system by the end of the first week. If you're lucky
and system integration went okay, you can add the collaboration
features and multimedia - with the total client code base for the whole
project coming within 1,000-1,500 lines. This is definitely not
possible with Swing. Of course, some people will say modern Java IDEs
generate lots of boilerplate code automatically, but this is still the
code that someone has to read, understand, and fix if needs be.
Having
said all this, there is a big difference between an application
prototyping and delivering a final product - you still need to write
code, create new components extend ActionScript classes and implement
interfaces. Flex is not a magic wand.
Flex: Room for Improvement
While
many programmers who dealt with previous versions of Flex are really
happy now that they have a professional Eclipse-based IDE, Java
programmers are spoiled by the variety of excellent and responsive
IDEs. Flex Builder helps a lot in writing Flex code, but it's not as
sofisticated and elegant as it could have been. It's even not as good
as its daddy Eclipse.
While you can use Flex just to connect to
your existing applications written as JSP or any other HTTP-compatible
technologies, you'll get performance gain if you'll use Flex remoting
and messaging that is build on fast Adobe proprietary protocols called
AMF3 and Real Time Messaging Protocol (RTMP). To take advantage of
these benefits you have to purchase Flex Data Services licenses, while
may not be affordable for small businesses.
Connection Management
Flex
provides an extensive infrastructure for managing connections between
the Web browser and the server. It lets you specify all the protocol
details for the RTMP, HTTP, HTTPS as well as plain socket connections.
You can then specify the order in which the protocols should be tried
due to availability/firewall issues. You also get alternative real-time
push or pull connections on additional protocols, a direct socket API,
and tons of low-level hooks that let you build any protocol you want.
Flex and Agile Development
In
mid-‘90s PowerBuilder and Visual Basic were the tools of choice in the
client/server field. Software developers didn't really worry about what
was under the hood, but more importantly, they were business users'
best friends. They could do stuff quickly, or using the modern jargon,
they were agile programmers without even knowing it. They'd ask the
business user Joe, "How do you usually do your business? What would you
like to have on this screen? Describe the steps of your business
process." Most likely Joe wouldn't know all the answers, but this was
okay, because developers could come back to the user the next day with
a working prototype. This was easy with PowerBuilder's DataWindow. When
Joe-the-user saw the prototype, his glassy look all of a sudden would
become friendly and understanding. Now Joe was back in control: "No,
you did this part wrong, I wanted it different." No problem, developers
would return with the changes the next day (not next month, but the
next day!).
Developers didn't really know how DataWindow worked,
but they trusted this component. PowerBuilder used event-driven
programming model, which was clean and simple. Object A triggers event
XYZ on object B, and this event can carry a payload - the data that
object B needs to operate. Using modern jargon it's called Inversion of
Control or Dependency Injection design pattern. What's important is
that the object B doesn't know about object A. On the same note, if
object B needs to return the result of some internal function back, it
would broadcast this result "to whom it may concern" by triggering one
of its own events. This is loose coupling in action.
The mentality
of many Java programmers was different. They'd assign lower priority to
the user's windows and spend most of their time designing a multi-tier
system that didn't depend on any specific look-and-feel and could be
universal. Meetings with Joe would be rare because they couldn't create
a decent prototype fast. Fancy IDEs with GUI designers like Matisse
weren't in the picture yet and, more importantly, Java programmers were
thinking big: UML, design patterns, application servers, and
clustering. They enjoyed the programming process for itself. They
didn't like the mindset of old-fashioned PowerBuilder or Visual Basic
programmers who were thinking windows and screens.
With Flex you
started to care about the business users again. You can change the
prototype twice a day, and Joe can do the same with his business
requirements. No pile of project documentation is needed. The napkin is
back and it works. Flex architects can give the server-side Java team
the final okay only after Joe is 100% happy.
Besides, with Flex we
can have the best of both worlds: the source code of the Flex framework
is available, we can learn how it works inside, and override some
functionality with what suits our needs better.
Working with Flex
promotes agile development, where the people we build the software for
are the driving force. Agile development methodology suggests
minimizing each development cycle to mitigate the risk of delivering
something to the users that they don't want. Agile development
encourages frequent face-to-face meetings with the end users as opposed
to preparing and sending documents back and forth.
Summary
This
quick overview of major RIA-enabling technologies and various
approaches to making Web applications richer. It's by no means a
complete list: new commercial and open source RIA frameworks and
components arise every day. Regardless of what RIA tools you are going
to select, start your evaluations now to get a competitive edge.
Published February 10, 2008 Reads 47,584
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
- Where Are RIA Technologies Headed in 2008?
- i-Technology 2008 Predictions: Where's RIAs, AJAX, SOA and Virtualization Headed in 2008?
- Moving Beyond AJAX: 2008 Is the Decision Year For RIAs
- Embracing New Platforms: Building RIAs Beyond AJAX
- Three RIA Platforms Compared: Adobe Flex, Google Web Toolkit, and OpenLaszlo
More Stories By Yakov Fain
Yakov Fain is a Managing Director of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Currently Yakov works on the book for O'Reilly "Enterprise Application Development with Flex". He twits at twitter.com/yfain.
![]() |
Ajax_is_a_hack 02/23/08 05:38:33 PM EST | |||
Hey Yakov, check out this: http://mx.sys-con.com/read/499659.htm OpenLaszlo - yeah, it's an *alternative*, but let's be honest--other than it not being backed by a major commercial developer (which many see as a good thing)--it doesn't have Flex beat on much of anything. (Flex is open source too...) I've read some other admittedly less biased comparisons and OpenLaszlo was graded lower I think in every category. |
||||
![]() |
jeff_s 02/11/08 04:22:03 PM EST | |||
This blog is certainly not an unbiased analysis, even though it's pretending to be just that. The article is basically "Flex rules, everything else drools". It goes on and on about the good things about Flex, while giving only cursory coverage of Flex drawbacks. Meanwhile, it's just the opposite regarding the other technologies, going on and on about drawbacks, and giving only cursory coverage of advantages. Case in point, Yakov says that Java Swing development is "hugely expensive". Nonsense. First, NetBeans is completely free, and NetBeans has the wonderful Matisse GUI designer, making the development of great looking Swing UIs a snap. Second, there is JavaFX, which is an XML based declarative scripting language that is used to quickly build rich Swing UIs super easy, and is very similar to MXML/Action Script, as is featured in Yakov's beloved Flex. Third, there is a plethora of third party libraries and controls in the Swing ecosystem, that further extends Swing capabilities, and makes Swing development easier. Then, Yakov fails to mention how expensive Flex Builder is (which, to be honest, you'll need to be truly productive with Flex), to the tune of $249 (as opposed to Free for NetBeans). Then Yakov goes on to say one of the drawbacks of Ajax is that it involves JavaScript. Wait a minute - JavaScript is based on EcmaScript, which Flex/Flash's Action is also based on. So Yakov, why does that syntax suck for one technology (Ajax), but it's great for another technology (Flex/ActionScript). C'mon. Yakov also completely fails to mention how much of a CPU hog Flash can be, especially on older/budget machines (which, let's face it, are quite common in the business world). So if you do a RIA with Flex, which is running in the Flash VM, you're going to get a lot of end users (corporate workers) complaining. Flex is quite good, and has it's advantages and disadvantages. Same with the other technologies mentioned in this article. But Yakov's article is completely biased in favor of Flex. That's fine, as Yakov has long been singing Flex praises. But he's presenting this article as a fair analysis, when it's anything but. Thus, anyone reading this article should take it with a grain of salt. |
||||
![]() |
Yakov Fain 02/19/07 07:49:38 AM EST | |||
Sebastien, not only I've mentioned OpenLaszlo in the article, but I also published my interview with the creator of OpenLaszlo: Am I cleared now or should remain ashamed? |
||||
![]() |
Sébastien Arbogast 02/18/07 05:43:34 PM EST | |||
It's such a shame that you don't even mention OpenLaszlo as an alternative for Adobe Flex... |
||||
- 4th International Cloud Computing Conference & Expo Starts Today
- Adobe Flex Developer Earns $100K in New York City
- Rhomobile CEO to Speak at iPhone Developer Summit 2009 West
- Rhomobile to Exhibit at Cloud Computing Conference & Expo
- Building a Social Site with Ruby and Rails
- Accelerating Innovation with Yahoo! Cloud Serving
- JetBrains' IntelliJ IDEA Goes Open Source
- Migrating from UNIX / RISC to Red Hat Enterprise Linux
- What Could You Do With Your Code in 20 Lines or Less?
- JetBrains Releases RubyMine 2.0
- Elance Work Index Reveals Strong Demand for Qualified PHP Programmers
- Get Time Tracker Source Code in SproutCore
- 4th International Cloud Computing Conference & Expo Starts Today
- Is Microsoft as Free as Open Source?
- Adobe Flex Developer Earns $100K in New York City
- Rhomobile CEO to Speak at iPhone Developer Summit 2009 West
- Rhomobile to Exhibit at Cloud Computing Conference & Expo
- Building a Social Site with Ruby and Rails
- Accelerating Innovation with Yahoo! Cloud Serving
- Enterprise LAMP Summit Asks Global Open Source Leaders “Can LAMP Deliver?”
- Engine Yard Gets More Money
- JetBrains' IntelliJ IDEA Goes Open Source
- Migrating from UNIX / RISC to Red Hat Enterprise Linux
- What Could You Do With Your Code in 20 Lines or Less?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- Ruby on Rails Won't Make It in 2007 and Forget About AJAX
- The Top 250 Players in the Cloud Computing Ecosystem
- The Jury's Still Out On Ruby On Rails (RoR) and AJAX
- Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
- Can Ruby Live Without Rails?
- An Introduction to Ant
- Testing in Ruby on Rails
- Ruby On Rails Moves At 'Acela' Rates Toward Java
- Java Kicks Ruby on Rails in the Butt
- Cyberhive Supports Ruby On Rails
- Ruby on Rails One-Day Seminar: Introducing Ruby on Rails – the Pain-Killer for Web Developers


































