Flex & Flash as Competitors to Java?

As [previously discussed][1], my friend Joshua from Sun [recently blogged][2] about how the consumer JRE will take market share from Flash in 2008. Today Sameer Tyagi , also from Sun, [blogged][3] about problems with using Flex to front-end JAX-WS. Both posts seem to insinuate Flash and Flex as competitors to Java. Yet for me Java and Flex have always been a perfect match.

The continued success of Flash and Flex only helps to better position Java in the enterprise. Adobe is not a threat to Java’s continued dominance on the server. In fact many Adobe enterprise products are built on the Java platform including Flex Data Services. If you must have an enemy then I suggest targeting those who actually have something to gain by Java losing market share in the enterprise. That is definitely not Adobe.

As I’ve [said elsewhere][4], Java and Flex developers should be working more closely together to make building RIAs easier for developers and to make experiencing those applications better for end users. Both technologies have similar values when it comes to openness, free tools and runtimes, and cross platform support. And the areas in which Java and Flex overlap are really very minimal. Developers and end users have much more to benefit by our harmony than by our discord. I continue to meet many people who are embracing this vision of a harmonious union of these two great technologies. I encourage others to consider doing the same.

Now to respond to Sameer’s disappointment “with the Web Services support, or lack thereof, in Adobe’s recent Flex 3.0 beta release” I built a quick Flex app which calls the non-trivial Web Service from the JAX-WS samples that Sameer referenced. Here is the code for what I came up with:

```

mx:Script

</mx:Script>

<mx:WebService id=“srv” wsdl=“http://localhost:8080/jaxws-supplychain/submitpo?wsdl” fault=“handleFault(event)” result=“handleResult(event)"> <mx:operation name=“submitPO”/> </mx:WebService>

<mx:Button label=“Submit PO” click=“submitPO()”/>

</mx:Application>

</div>

This is a very simple example and doesn't have the UI necessary to actually assemble a PO based on user input. That piece would also be trivial so I've left it out of this example. The key thing is that it correctly talks to the JAX-WS based Web Service. This is just one example which uses Java and Flex together. There are many more. And there are plenty of enterprises happily using Java and Flex together. Pitting these technologies against each other does nothing to benefit developers or end users.

 [1]: http://www.jamesward.org/wordpress/2007/07/26/2008-the-year-of-client-java/
 [2]: http://weblogs.java.net/blog/joshy/archive/2007/07/java_fx_updated.html
 [3]: http://sameertyagi.blogspot.com/2007/07/flex-web-services.html
 [4]: http://www.oreillynet.com/onjava/blog/2007/05/java_se_media_or_not_at_javaon.html#comment-630117