The Artima Developer Community
Sponsored Link

Weblogs Forum
Hybridizing Java

129 replies on 9 pages. Most recent reply: Mar 18, 2011 4:41 PM by David Benson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 129 replies on 9 pages [ « | 1 2 3 4 5 6 7 ... 9  | » ]
Fabrizio Giudici

Posts: 14
Nickname: fgiudici
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 1:03 PM
Reply to this message Reply
Advertisement
I don't think Flex is not entrerprise ready. I'd appreciate it more than Ajax for sure (I agree that Ajax is nothing more than a hack, even though a working hack). Nevertheless I still don't understand which is the big advantage over Swing. Faster? Cooler? More reliable? Easier to deploy?

Maybe in the middle of a couple "Flex is just fantastic" stuff somebody can give me an answer? :-))

Chris Luebcke

Posts: 2
Nickname: cluebcke
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 1:06 PM
Reply to this message Reply
Hi Dave,

In my experience the typical RIA built with Flex does involve using a single Flex application for the entire UI, rather than having one or more smaller apps residing on a web page that also includes content generated by JSP, PHP, etc. That's been the case with the two enterprise RIAs I've worked on, and in the others I've looked at.

You certainly can wrap Flex apps in a Web interface that contains other content, though; the Flash player can talk to its browser, the browser can talk to the embedded object that is the Flash player running your app, and a framework for taking care of the plumbing for this has been provided by Adobe (nee Macromedia) Labs in the form of the Flex-Ajax Bridge: http://labs.adobe.com/wiki/index.php/Flex_Framework:FABridge

HTH,
Chris Luebcke
UI Architect, DecisionView

Les Stroud

Posts: 7
Nickname: lstroud
Registered: Jul, 2003

Re: Hybridizing Java Posted: Jan 31, 2007 3:14 PM
Reply to this message Reply
I agree with some of your points in principle. I think that java suffered due to some early decisions and a variety of politcal issues. Some folks did a bang up job trying to make java incompatitble and hard to install. Those same folks made flash more readily available or allowed it to be preinstalled on OEM boxes.

With that said, my perspective on flash was tainted when I tried to develop an app in flash. I am sure flex is much better. However, trying to create an object based gui model integrated with a movie time line approach in a language that is somewhere between java and javascript was a nightmare at best. Simple things, like positioning a control or creating a list, were just plain hard. You had to write code to go to jump points in a movie and expose/hide layers. None of that was fun. All I wanted was to say, 'put this thing at this spot now'. However, they were modeled more for a graphic artist to add some scripting instead of being modeled for a ui programmer to add some graphics.

Flex may have changed all of this. I don't know. At the very least, applet folks who have always wondered about the applet startup time argument can look at flex and say BS. The idea that they can have a full vector graphics rendering engine that starts up instantaneously, run code, and display images flies in the face of those who have said that it is impossible with the jvm. I've heard all of the arguments, but flash did it and java did not. Java also never put out a tools that the content producers could use (graphic artist types). As a result, applets were used by programmers. Unfortunately, those are not the guys that put together the really kewl looking stuff. Artist sorts do that and they use flash.

All that said, there is no nirvana. We are bouncing back and forth on a damped sine wave to some hybrid between server side and client side computing. We don't want to give up the control of the server or the performance of the client. When you start to add in things like security, local integration (aka password management, etc), graphic capability, reliability, etc...well, all of these things get very grey. For instance, when is the last time you saw a flash app integrate with your OS's desktop, or query your OS password repository? If those capabilities are added, is the flash plugin secure enough? If that flash plugin is used to access your bank account, would you trust it? Some of these questions java has an answer for and some it doesn't. Java was designed from the ground up with security in mind. Flash was not. Futurewave just wanted to create good animated content. For that, security was unnecessary overhead. I am sure flash has more security now, but it was added after the fact. So, maybe they got it right and maybe they will have the same problems windows has had. On the other side, java is not very good at making the user experience reliable in a browser model. The graphics capabilities of java are just now (mustang timeframe) getting emphasis. Java does not have a web content tool that simplifies that programming model for those that just want to do a cool animated intro. The point is, there is no silver bullet. Frankly, I doubt that there ever will be. We will just go through a continuous set of iterations of better as the requirements for correct continue to shift in front of us. The only real nirvana to find there is that at least it will keep us all employed. :)

Thanx for sparking the conversation. It should be an interesting ride.

LES

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: Hybridizing Java Posted: Jan 31, 2007 3:49 PM
Reply to this message Reply
In addition to the installation issues (which to some extent have been solved in recent JDK versions - too bad, most people have older JRE versions pre-installed), many more issues made Swing applet development hard.

To create a nice-looking Swing UI is relatively easy now with Java, using tools such as the NetBeans GUI builder, and third-party look and feels. But that's the easy part of creating a real Swing app (or rich-client app, for that matter).

More challenging problems are data binding, and the whole notion of having to deal with multiple copies of the same data: one copy of the server, and one copy on the client's UI model, and then there's a presentation of that same data in the client's UI layer, too.

By contrast, traditional Web apps just don't have to deal with that, because the presentation is generated on the server, possibly even in the same transaction as the one that fetched that data in the first place.

This is really not a Swing/applet issue, though, but Swing/Java provide very few tools to deal with this issue. Ajax apps may not worry too much about that, if only because most Ajax apps tend to be simple, or deal with simple data. Else, Ajax developers may just think of that data as strings, and not as full-fledged JavaScript objects.

But if you have a huge amount of server data, such as an inventory-type app, and you want to write an applet interface to it, you will have to confront this data multiplicity issue, and its solution is non-trivial. In fact, I've found that the vast percentage of code in a Swing-based app has to be written to deal with this very issue - code that's basically plumbing and wouldn't have to be written if one were to write just a simple Web app sans Ajax/Swing/RIA.

Flex has the data services product going for it, and that may be one of the most significant ways it's ahead of Swing/applets, although I must say I never tried the Flex solution and thus do not know how well it actually works.

Swing would need a similar integration with server-side data. I know that some JSF components provide that, but Swing would desperately need a solution of its own.

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: Hybridizing Java Posted: Jan 31, 2007 4:25 PM
Reply to this message Reply
Another comment I have is that the Swing/applet approach is not helped by the lack of a comprehensive architecture that is both simple and also works well. By comprehensive, I mean one that addresses every aspect of building an app, from server-side data to client side presentation. Whatever its failings, at least J2EE provided that.

What I see now slowly emerging is a REST + RIA/Ajax approach. On the server, you have a REST API (which can be created in whatever environment, Java, Rails, etc), and then the client manipulates resources in a visually rich environment. I'm just now beginning appreciate some of the simplicity REST can bring to Web apps, and I think REST makes the most sense for apps with a rich UI.

To what extent do others agree that REST + RIA are a good match?

Fabrizio Giudici

Posts: 14
Nickname: fgiudici
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 5:01 PM
Reply to this message Reply
> More challenging problems are data binding, and the whole
> notion of having to deal with multiple copies of the same
> data: one copy of the server, and one copy on the client's
> UI model, and then there's a presentation of that same
> data in the client's UI layer, too.
...
> Flex has the data services product going for it, and that
> may be one of the most significant ways it's ahead of
> Swing/applets, although I must say I never tried the Flex
> solution and thus do not know how well it actually works.

Can you give us a pointer to learn something about these "data services" in Flex?

Thanks.

James Ward

Posts: 42
Nickname: jlward4th
Registered: Jun, 2006

Re: Hybridizing Java Posted: Jan 31, 2007 5:19 PM
Reply to this message Reply
The best way to learn about Flex & Data Services is to take the Flex Test Drive:
http://www.adobe.com/go/flextestdrive

Let me know how it goes.

-James
james<at>jamesward<dot>org
http://www.jamesward.org/

Karl Guertin

Posts: 4
Nickname: grayrest
Registered: Jan, 2005

Re: Hybridizing Java Posted: Jan 31, 2007 5:33 PM
Reply to this message Reply
I'll skip commenting on the Java portion of this essay and focus on the web/flash portion. I'm a long-time javascript programmer, so this will be a bit biased.

All I'll say on the Java/applet stuff is that I dislike java applets because the annoying startup and the fact that (virtually) all of them are really ugly.

IE only sites: The only ones I've run into in the past 3 years are MS sites. It's anecdotal and I tend towards geek websites, but I just don't see IE only sites anymore.

CSS: Blame IE. Everything else is reasonably close.

Cross-platform JS: Use a library. I fail to see the advantage of writing your own code when you can pick up mootools for 15 K and not have to deal with it. Brendan Eich has said that JS was a quick hack and never really got community feedback until the past year or so and it therefore lacks a standard library. The various JS libraries fill that gap.

Limits: Current limits on js are due to IE. I do not think we're at the limit of what can be done. A native SVG and/or canvas implementation on IE is all that is missing for a non-plugin gliffy. It's perfectly possible to do gliffy without plugins in everything except IE. I wouldn't choose to do so today, Flash is better suited to this problem domain, but that's not what you said.

We also don't see too much comet interaction (I don't consider ajax to be a hack, but comet IS a hack and a half). This is due to server issues and lack of a standardized communication protocol, both of which the dojo folks are working on.

With those two problems solved, you'll see considerably richer apps from the javascript space. When that will happen is anybody's guess and I'm not going to suggest we wait for it.

gmail keys: Re-clicking on the web page gets the keyboard shortcuts to work again. It's a focus issue but I don't understand why. Not an exuse, just a tip, but flash suffers the same focus problems. There are also greasemonkey scripts for extended gmail macros that fill in some of the keyboard gaps in gmail. Recommended. No clue on the ctrl+c.

On the Actionscript/Javascript/ECMAScript superset: Actionscript 2.0 is ECMAv4 while Javascript on the web is ECMAv3. ECMAv4, not Macromedia/Adobe, added features like type checking, imports, etc. I don't think AS 2.0 has any extensions on ECMAScript v4.

Flash: Haven't used flex, but I do use flash as a cross platform drawing api. It's really nice for that. I do not like building whole apps in flash because it integrates poorly with the rest of the page. Here's hoping Apollo allows us to mix HTML and movie clips the way we can mix HTML and SVG in current browsers.

I have used what I assume is flex on the Adobe website and it's in the uncanny valley of cross-platform compatibility. It's very close, but there are a number of details (scroll wheel support is the big one) that just do not behave correctly. I haven't really seen anything outside of motion vector drawing that can't be done without plugins. Make no mistake, Flex is a lot less effort than custom coding something that acts similarly, but the custom code works with your CSS and integrates into the page while Flash tends to be it's own island.

In short, I haven't given up on Javascript yet. Here's hoping to a bright future for both environments.

Mark Nuttall

Posts: 13
Nickname: mnutty
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 6:16 PM
Reply to this message Reply
Well, started the Test Drive. The first thing to hit me was "MXML, an XML language used to declaratively lay out the user interface of your application." Is there any other way? Pure declarative languages make it difficult to do complex and dynamic Application UIs.

James Ward

Posts: 42
Nickname: jlward4th
Registered: Jun, 2006

Re: Hybridizing Java Posted: Jan 31, 2007 6:33 PM
Reply to this message Reply
MXML is a declarative, XML based language on top of ECMAScript. You can use either one or combine both. Typically I use MXML for layout and ECMAScript (ActionScript) for procedural logic. Here is a good article highlighting the differences between MXML & ActionScript:
http://www.adobe.com/devnet/flex/quickstart/coding_with_mxml_and_actionscript/

Rafael Ferreira

Posts: 8
Nickname: rafaeldff
Registered: Feb, 2006

Re: Hybridizing Java Posted: Jan 31, 2007 6:43 PM
Reply to this message Reply
Have you guys checked out the F3 scripting language? It won't solve deployment difficulties (that have, as already mentioned, been much improved on recent JREs), but it appears to be very helpful in bringing JVM-based RIA development to Flash's level of simplicity.
There is a nice overview in LtU: http://lambda-the-ultimate.org/node/1998 .
Several code examples and tutorials can be found at Chris Oliver's weblog: http://blogs.sun.com/chrisoliver/ .

The interpreter isn't yet generally available, but it will be released as open-source in the near (I hope) future.

Rafael Ferreira

Posts: 8
Nickname: rafaeldff
Registered: Feb, 2006

Re: Hybridizing Java Posted: Jan 31, 2007 6:46 PM
Reply to this message Reply
I forgot to check if F3 has already been mentioned at Artima, and it was, here: http://www.artima.com/forums/flat.jsp?forum=276&thread=184337
Sorry about that.

Mark Nuttall

Posts: 13
Nickname: mnutty
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 6:57 PM
Reply to this message Reply
> Another comment I have is that the Swing/applet approach
> is not helped by the lack of a comprehensive architecture
> that is both simple and also works well. By comprehensive,
> I mean one that addresses every aspect of building an app,
> from server-side data to client side presentation.
Swing + Spring + Spring Remoting + Hibernate. Very easy

Mark Nuttall

Posts: 13
Nickname: mnutty
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 7:11 PM
Reply to this message Reply
> More challenging problems are data binding, and the whole
> notion of having to deal with multiple copies of the same
> data: one copy of the server, and one copy on the client's
> UI model, and then there's a presentation of that same
> data in the client's UI layer, too.
>
> By contrast, traditional Web apps just don't have to deal
> with that, because the presentation is generated on the
> server, possibly even in the same transaction as the one
> that fetched that data in the first place.
>
> This is really not a Swing/applet issue, though, but
> Swing/Java provide very few tools to deal with this issue.
> Ajax apps may not worry too much about that, if only
> because most Ajax apps tend to be simple, or deal with
> simple data. Else, Ajax developers may just think of that
> data as strings, and not as full-fledged JavaScript
> objects.
>
> But if you have a huge amount of server data, such as an
> inventory-type app, and you want to write an applet
> interface to it, you will have to confront this data
> multiplicity issue, and its solution is non-trivial. In
> fact, I've found that the vast percentage of code in a
> Swing-based app has to be written to deal with this very
> issue - code that's basically plumbing and wouldn't have
> to be written if one were to write just a simple Web app
> sans Ajax/Swing/RIA.
>
> Flex has the data services product going for it, and that
> may be one of the most significant ways it's ahead of
> Swing/applets, although I must say I never tried the Flex
> solution and thus do not know how well it actually works.
>
>
> Swing would need a similar integration with server-side
> data. I know that some JSF components provide that, but
> Swing would desperately need a solution of its own.
I just don't get this. I have a Web Started Swing app. It was developed to run on one machine and using Spring Remoting was able to get it remoted in <1 day. I think the real problem is that people are not familiar with Swing and with all the things possible with Java.

Corba The Geek

Posts: 1
Nickname: corbadgeek
Registered: Jan, 2007

Re: Hybridizing Java Posted: Jan 31, 2007 11:41 PM
Reply to this message Reply
Bruce,

I've developed GUIs using AWT, Swing (Applets and Applications) and Flex and I have to agree that Flex is probably the most satisfying. My brief forays into JavaScript and Ajax have left me with the same impressions you had: difficult to build and maintain and lots of cross-browser incompatibilities. I was just starting to look into OpenLaszlo and appreciate the comparison between Flex and Laszlo. Your article/blog is right on!

Flat View: This topic has 129 replies on 9 pages [ « | 1  2  3  4  5  6  7 | » ]
Topic: Scala 2.8.0 + Lift 2.1 + IntelliJ: First Step(s) Previous Topic   Next Topic Topic: Security Debt


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us