Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Java Programming Sun Microsystems

Sun Debuts JavaFX As Alternative To AJAX 441

r7 writes "Internetnews is reporting on Sun's introduction of JavaFX at JavaOne today. Looks like a combination Applet, Flash, Javascript, and AJAX with a friendly programming interface. Does this really spell the end of AJAX? I sincerely hope so. Nothing built on Javascript will ever achieve the security, cross-platform reliability, and programmatic friendliness that Web 2.0 needs. Proprietary solutions and vendor lock-in are also dead ends. JavaFX has the potential to satisfy this opportunity even better than did Java over a decade ago. Along with AJAX, let's hope JavaFX also puts paid to Microsoft's viral Active-X and JScript, and, more importantly, that it really is a web scripting language that developers can grok."
This discussion has been archived. No new comments can be posted.

Sun Debuts JavaFX As Alternative To AJAX

Comments Filter:
  • by QuantumG ( 50515 ) <qg@biodome.org> on Tuesday May 08, 2007 @05:26PM (#19043453) Homepage Journal
    Applets, and Java in general, are notorious for long startup times.

    It has been found that people give a web site about 2 seconds to respond before they determine it is not going to load and surf away.

  • So we're moving away from a de-facto standard that is already implemented with free software, towards the proprietary Adobe Flash platform and the vendor lock-in that it implies?
  • Does this really spell the end of AJAX? I sincerely hope so. Nothing built on Javascript will ever achieve the security, cross-platform reliability, and programmatic friendliness that Web 2.0 needs.

    Did it occur to you that you're sounding exactly like the hype you're decrying?

    AJAX is a stupid name developed for the ole' hype machine (mostly to sell conferences and books, methinks) but the basic web technologies behind it are NOT THAT BAD. To use the example from the article, am I "tearing [my] hair out over as [I] attempt to get the JavaScript working in both Internet Explorer and Firefox?" Actually? No, I'm not. And I just implemented a Comet [wikipedia.org] library in both Javascript and Actionscript. About the most frustrating thing was the fact that Opera ignored the cache-disable commands when using XML.load in Flash. So I build a solution into the library. And if you think that's fun, wait until I detect Server Side Events in Opera and use XMLSockets in Actionscript!

    *shrug*

    Oh, and I had to dynamically patch Safari and Opera to add support for the toSource function. Easy as for(var i in object) pie.

    The problem with most "AJAX coders" is that they still think of Javascript as that cutesy language they used to do scrolling statusbar text with. But it simply isn't that bad. In fact, Javacript is a full-up, Object Oriented (or at least, OOP capable) langauge that fits the lightweight needs of the web browser perfectly. Java is a 600 pound gorilla that's better for designing heavyweight applications that are secure, robust, fast, and feature complete. The two target very different markets.

    As for JavaFX, there is (if you'll excuse the expression) "nothing to see here". It's just a Silverlight competitor. Which makes it just as questionable as the product against which it's competing. If you really want a replacement for XMLHttpRequest, use XMLSocket [devpro.it] instead,
  • Proprietary (Score:2, Insightful)

    by Anonymous Coward on Tuesday May 08, 2007 @05:27PM (#19043471)
    "Proprietary solutions and vendor lock-in are also dead ends"

    Or... not.

    Using Java solutions over .NET because you have a stick up your ass is a little silly.

  • by Fireflymantis ( 670938 ) on Tuesday May 08, 2007 @05:29PM (#19043509)
    Java 5 and (even more so) 6 have really helped curb the init time of applets. Plus on windows, IIRC it stays resident so after the first instantiation of the Java VM, load up times are very small. This is not including the time required to download the required classes for the applet, but it would probably be no worse than waiting for a heavy javascript laden page to load up.
  • End of Ajax.... (Score:5, Insightful)

    by BuR4N ( 512430 ) on Tuesday May 08, 2007 @05:32PM (#19043557) Journal
    That would be great, but in reality, when people invest enough money into something and there is ubiquitous support for it, it tend to stick and migration to something new drags on forever.

    And there is so much big corporate inter politics involved with each side rallying their alternatives that it looks like we are stuck with the lowest common denominator, that beeing for the moment javascript.
  • by Anonymous Coward on Tuesday May 08, 2007 @05:34PM (#19043635)

    Does this really spell the end of AJAX? I sincerely hope so.
    Yes, we will all be switching to Java for the sole purpose of defeating the evil that is AJAX. Dumbass.
  • Re:Hmm (Score:5, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman@gmaYEATSil.com minus poet> on Tuesday May 08, 2007 @05:37PM (#19043683) Homepage Journal

    I really hate when people refer to Active-X as "viral" or something similar... Active-X is a technology like any other

    Actually, ActiveX is a patented Microsoft Security Hole(TM) big enough to drive a Mack Truck through. Effectively, Microsoft looked at Java Applets and said, "The biggest problem with it is that it doesn't access Windows APIs and has all that security BS. We can do better." Next thing you know, Microsoft "partners" are showing how you can access DirectDraw and Direct3D to make ActiveX components that were WAY more impressive than the simplistic animations that Java was capable of. Of course, the security implications hit Microsoft less than a year later as Malware started exploiting the system for all kinds of nefarious purposes.

    Microsoft kinda-sorta shuffled it off into other areas after that. Now they're back with a vengence. Silverlight will be everything that ActiveX was going to be, but BETTER! Can you feel the excitement? :-/
  • by MBCook ( 132727 ) <foobarsoft@foobarsoft.com> on Tuesday May 08, 2007 @05:48PM (#19043893) Homepage

    Java Script isn't so bad! Sure I had to patch browsers and write a different version for each one. I made my own library and blah blah blah.

    Sounds bad to me. Javascript is very annoying, mostly due to the incompatibility between browsers, but for other factors as well. I welcome this. And how do you know JavaFX will be so bad when they have only announced it and haven't previewed it? Worst case scenario, it feels like using the Google Web Toolkit but doesn't produce large .js files that you have to include. It isn't going to run the full Java VM and load up support for all the little libraries (OpenGL, sound, etc). It's designed for this, I'm betting it will be rather speedy. It will certainly be up there with Flash.

    This sounds like it is targeting more than just "fetch this list box dynamically" by trying to be a way to make web pages that are currently only realistically implementable by making the entire thing in Flash.

    Also, Javascript may have gained abilities over the years (like OOP), but Java has had it from the start. Java has the ability to do static typing. OOP isn't bolted on. It wasn't an afterthought.

    Note: after reading your post once or twice, I'm having a hard time telling if the whole thing was sarcasm or not

  • by abes ( 82351 ) on Tuesday May 08, 2007 @05:51PM (#19043965) Homepage
    AJAX has given web-pages a new breath of life. Things like google-maps, netflix, etc. have definitely done things I wouldn't have thought possible before. And packages like RoR have managed to find ways to automatically generate most of the AJAX you need.

    I don't claim to be an AJAX expert, but it seems really good for the simple things you need to do. You can find 10 libraries now that give you collapsable boxes, drag-n-drop, etc. But it gets much more complicated if you want to do something not covered with these libraries.

    The big problem being that put very simply: HTML was not designed for full-fledged interfaces. Compare against a beautiful library like Cocoa, and it falls very very short. Which is fine. It's great for what it does.

    Java is many ways was supposed to fix this problem. A method to create interfaces that can be spread through web pages. But issues besides just speed have been a problem with Java. AWT was not great for making interfaces, and Swing isn't (IMHO) much better. I haven't tried SWT, but even Eclipse, its flagship, suffers from all types of interface issues (compare it against an IDE like XCode).

    I'm trying very hard not to be an Apple fanboi. I've used PCs for most of my life, and Linux for a good enough time (> 10 years). But I've seen enough interface libraries now (GTK+, KDE, Windows API, Javascript hacks, various ones using SDL, etc.) that I've seen both highlights and major downfalls from the different design paradigms used.

    One of the largest design issues I've seen comes from at the end of the day from the language itself. Part of A large part of Cocoa's beauty derives from Objective-C. It does things that c++ wouldn't dream of doing for speed reasons. Both Gtk+ and KDE try to replicate features already in Objective-C, but because they are non-native, they don't/can't do it as well. Which is not to say Objective-C is the end-all be-all language -- it's just great for interfaces.

    It's also something that from my personal experience Java can't do. So it's hard for me to imagine how using Java to make an interface for web pages will be a great advancement (again, I'm leaving speed issues alone -- this is a purely design argument). And maybe it will be better than AJAX, but that's not a great advancement .. a small increment without actually fixing any of the big issues.
  • Re:Hmm (Score:1, Insightful)

    by Jason Hood ( 721277 ) on Tuesday May 08, 2007 @05:51PM (#19043979)
    Okay, what exactly does slow mean? In many cases Java is actually faster than similar implementation is lower languages such as C. Specifically in memory intensive applications. google is your friend.

    If you mean slow by startup time on low speed platforms, Java does lag behind a bit. However also announced today, is that sun is working on a micro-kernel for the JVM that will only load and install classes that are used by the runtime. They had some MB numbers, many common java apps had their initial memory footprint cut to 1/10th. Once this happens, JavaFX will load faster than flash, open source, be more portable and easier to code against. It will be used natively on phones, desktops and PDAs.

    So I would think if you are for open software and are a developer, you certainly would want JavaFX to take off. Given its scope there is no current alternative anyway. Unless you are JavaOne (like the me) and seen the demos and spoken with the actual developers, it would be very hard to understand what JavaFX really is. Comparing it to AJAX is not accurate. Its an optional wrapper for swing that works in rich clients and flash like applets. FX apps might still employ AJAX depending on what you want to do.

    Sorry, had to quash the disinformation.
  • Re:ajax just works (Score:3, Insightful)

    by BrookHarty ( 9119 ) on Tuesday May 08, 2007 @05:56PM (#19044075) Journal
    Really, Sun is pulling a fast one, JavaFX competes with Flash and Silverlight, a graphical environment for devices, with web browsers as a bonus. Security concerns and downloadable plugins are just a smokescreen to make the product look bigger than it is. Compete against Ajax for the browser? Noway, but it is an attractive solution for hand held devices.
  • by QuantumG ( 50515 ) <qg@biodome.org> on Tuesday May 08, 2007 @05:59PM (#19044135) Homepage Journal
    The average user will never do that.

    It's just confusing to them.. and it has a negative effect on performance when they fiddle with it.

    More importantly, it's a change to their desktop which happens outside the browser window in response to going to a web page. Users don't really understand that it is the browser that spawned this.. they think that it was the web page that spawned this, and they understand that web pages shouldn't be able to put icons into their systray.

    All in all, it's a dumb idea.. and Sun should have done some user testing to see what the user's reaction to it was.
  • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Tuesday May 08, 2007 @06:03PM (#19044191) Homepage Journal

    It has been found that people give a web site about 2 seconds to respond before they determine it is not going to load and surf away.

    Actually, it's four seconds [bbc.co.uk], but what the hell, you're only off by 50%.

  • by QuantumG ( 50515 ) <qg@biodome.org> on Tuesday May 08, 2007 @06:05PM (#19044223) Homepage Journal
    and the reason for that is Adobe actually worked with browser makers to have Flash pre-installed, pre-loaded and, if it is not, easy to install. They actually did QA to ensure that the plugins work in all the different configurations of hardware and OS that people run browsers on.

    As far as I can tell, Sun never did that for Java.

  • Seems I confused you with my slightly sarcastic tone. "for(var i in object)" is a core part of Javascript and the way it works. That feature (and what it implies) are why it's so simple to fix different browsers to work like one another. If you don't know how to use it, you shouldn't be coding web apps.

    Also, OOP is not bolted on in Javascript. It's been there since nearly the beginning. It's just that 99% of web coders never actually learned how to code Javascript.

    How do you know JavaFX will be so bad when they have only announced it and haven't previewed it?

    I've been a Java programmer for about 11 years. In that time, I've explored the VM and libraries inside-out, upside-down, and sideways. The conclusion I've come to is that Java in the browser is a bad idea. At least in the form of the J2SE. If it had been developed more like a J2ME plugin with access to the DOM, it might have been a decent replacement for Javascript. But it wasn't developed that way, and now I think it's not in a very good position to compete in that space.

    This sounds like it is targeting more than just "fetch this list box dynamically" by trying to be a way to make web pages that are currently only realistically implementable by making the entire thing in Flash.

    You bring me requirements, and I'll show you the magic that modern web technology can perform. And it's only going to get better. My comments about Server Side Events and XMLSocket are meant to mention how much better it's going to get. SSE will effectively obsolete Comet-style requests, resulting in rich server "push" systems that can transmit nearly anything to the client on demand. No need to worry about different XMLHttpRequest implementations, it will all be automatic in the browser. Opera already supports this, and thanks to the magic of Javascript, it's easy to branch to code that makes use of it when available. Wrap it in your libraries, and you're ready. to. ROCK! :)

    Java has the ability to do static typing.

    Which is its strength as a platform, and its weakness as a scripting language. Don't get me wrong, the computer scientist in me wants to go with static typing. I love static typing. It makes all the bad problems go away. But the web coder in me knows that distributed document technology needs something more flexible. Dynamic typing as in Javascript is that flexibility.

    It's slightly out of date, but you might find this article I wrote [intelligentblogger.com] to be interesting. Web technologies are really accomplishing what Sun envisioned all those years ago.
  • by DragonWriter ( 970822 ) on Tuesday May 08, 2007 @06:11PM (#19044313)

    We are moving from using an open language (Javascript) that can be a real pain (thanks to all the different browsers ways of interpreting and using things) to an open language (JavaFX will be open sourced according to the FAQ) that will have a good reference implementation and should alleviate many of these annoying little things about JS, without having to use something as heavy or overkill as Flash.


    Is the JVM really less "heavy or overkill" than Flash?
  • Stupid branding. (Score:5, Insightful)

    by mattgreen ( 701203 ) on Tuesday May 08, 2007 @06:24PM (#19044543)
    I'm so sick of companies thinking they'll somehow become relevant because they put reminders of their products in every nook and cranny on my system. Sun, like all other half-wit companies, feels the need to put useless tray icons in there to brand the user's computer. You'd think after the Internet's collective hate of RealPlayer they would have learned that the systray is not for advertising. Besides, people don't care what Java is, they want to look at what is on the page. But no, they have to sit there in the tray, completely useless. And lets not discuss needing to run a program 24/7 that monitors for updates to Java, or installing a control panel.

    Sorry Java, you're not nearly as important as you think you are. QuickTime commits the same set of sins, which is why I swear by QuickTime Alternative, it is a bit less annoying.
  • by josath ( 460165 ) on Tuesday May 08, 2007 @06:28PM (#19044615) Homepage
    Gee, Flash 9 / Actionscript 3 has all of those features:
    * Static strict typing, that throws a runtime error if you try to cast to an incorrect type
    * Compiled into bytecode, with a JIT runtime
    * Cross-platform (windows, mac, linux and solaris)
  • by Xenkan ( 1099507 ) on Tuesday May 08, 2007 @06:40PM (#19044801)

    Nothing built on Javascript will ever achieve the security, cross-platform reliability, and programmatic friendliness that Web 2.0 needs.

    Security - Javascript is NOT designed to secure a web app, security needs to happen on the server side, out of necessity!

    Cross-platform - I would argue that Javascript / ECMAScript, having been standardized and distributed with all major browsers for years, is arguably the MOST supported cross-platform programming language in the world. If a computer has a browser made in the last 5 years, it supports standardized ECMAScript. And what PC doesn't have a browser?

    The only incompatibilities I run into on a frequent basis are getting my scripts to create results that look the same across all browsers, and that's not Javascript's fault, it's CSS and browser support of CSS! If you have problems with the [i]functionality[/i] of Javascript, then you're probably not writing according to the well established standards, or worse yet, throwing together snippets of Javascript from all over the web like so many amatuers that give the language a bad rep.

    Proprietary solutions and vendor lock-in are also dead ends

    So you would use Sun's solution, rather than the well established internationally standardized ECMAScript?

    Programmatic friendlyness - Joel says it all here [joelonsoftware.com] Personally, I've programmed in dozens of languages, and few are as flexible and enjoyable as Javascript

    Javascript used to have the same status that Java applets and Flash still do, used predominantly for play things, small self-contained segments of the browser where you want to do something different. Javascript has risen above that. The world is finally realizing Javascript can be an integral part of an entire website, and that the website as a whole can be enhanced by Javascript and it's tight integration with other web standards.

    This article sounds like an attempt to rehype Java applets, which frankly, have not seen the advancement and acceptance that Javascript has over the years.

  • by _damnit_ ( 1143 ) on Tuesday May 08, 2007 @06:59PM (#19045115) Journal
    Does this mean I'll have to have the exact right version of Java to see a webpage now? The "write once, run anywhere (where the matching version of java is installed)" problem will get very annoying for people on Web 2.0 sites.
  • But it's still a proprietary platform without free implementations.
  • by Anonymous Coward on Tuesday May 08, 2007 @07:07PM (#19045235)

    If you don't know how to use it, you shouldn't be coding web apps.
    How about something more like "if you don't know how to use it, explore these links." The repetitive arrogance throughout your posts on this topic tend to make you look something of an asshat. HTH.
  • by Nullav ( 1053766 ) <moc@noSPAM.liamg.valluN> on Tuesday May 08, 2007 @07:35PM (#19045595)
    It doesn't run on an alarm clock, either. Cross-platform means that it can run on more than one platform, not everything known to man.
  • by try_anything ( 880404 ) on Tuesday May 08, 2007 @07:52PM (#19045763)

    It is well-known that Java is a "write once, debug everywhere" solution.
    Funny, I worked in a Java shop with dozens of programmers where nobody developed on the deployment platform. We deployed to Solaris, but we developed, tested, debugged, etc. on Windows and Linux. In most cases, new code never ran on Solaris until it was sent to QA. When a bug was found on Solaris, we reproduced it and debugged it under Windows. This never caused any problems, nor do I recall tests ever passing under Windows and failing under Solaris, or vice-versa. This was in 2000-2002.
  • by cyphercell ( 843398 ) on Tuesday May 08, 2007 @08:29PM (#19046151) Homepage Journal
    Target audience asshat. Seriously, if you can't see the value of your site being read from phones, gaming systems, and a gamut of other weird little web browsers then you really don't understand the market. Right now 90% of all browsing is from pcs and laptops, but this isn't always going to be true, in fact since javascript (AJAX) is ubiquitous I would suggest that the only place Web 2.0 players are competing is in support for these new browsers. Hell if you really think about it, AJAX is the rape child of M$ and Jscript, which was used to snuff out Netscape and compete better with Java. Any developer that remembers or has slightly studied the browser wars of the nineties should be running in horror every time someone says Web 2.0 in relation to a new system designed to compete with Javascript (that's right it's not AJAX). Our energy is better spent on getting Javascript support for these new browsers and perfecting what we already have. Everything else is busy work, designed to benefit M$, Sun, and anyone else out there playing up the new Web 2.0 paradigm shift in server integrated markup and content delivery.
  • by ClosedSource ( 238333 ) on Tuesday May 08, 2007 @09:19PM (#19046545)
    "Also, you can't really blame Sun for not having Java pre-installed on most desktops. There were certain monopolists doing everything in their power to prevent Java's emergence as a solid platform."

    Sure, that's why AOL wasn't successful in the dial-up era, unnamed monopolists prevented them from sending out install CDs or making deals with computer companies. Oh wait ...
  • by ClosedSource ( 238333 ) on Tuesday May 08, 2007 @09:26PM (#19046625)
    "There's no reason why the Java plug-in can't just spawn off a thread and return control to the browser. The page can continue to render while the applet loads."

    What useful content is going to be rendered while the applet loads? It's like saying Window's boot time isn't problem because you can watch the Windows logo while the OS is loading.
  • by ispeters ( 621097 ) <ispeters@alumni. ... ca minus painter> on Tuesday May 08, 2007 @10:32PM (#19047191)

    I love static typing. It makes all the bad problems go away.

    I suppose that maybe you were being facetious or sarcastic, or maybe you were simplifying, but static typing hardly "makes all the bad problems go away". Unfortunately, I don't remember who originally said it, so I can't properly attribute it, but, paraphrasing, "static typing is the compiler doing some cursory testing on your code". To raise your level of certainty that your programme is bug-free, you have to do a lot of testing. If you use a statically-typed language, then the compiler will do some testing for you--it'll tell you that every time you call a function, the arguments you pass are the correct type and the return value is stored in a variable of the correct type. It won't tell you whether or not your code contains a logic error. Passing the wrong object to a function is an error in the programmer's reasoning that is, arguably, akin to the traditional kind of logic error that compilers gleefully use to generate segfaults and buffer overruns. To catch these sorts of things you need unit tests and integration tests and the whole shebang.

    I think, in the typical case of Javascript in the browser, the fundamental problem is the combination of incompatible implementations, the piss-poor development environment, and the apparently widespread belief that you can write Javascript code by cutting and pasting. For anyone interested in improving their Javascript development environment, I recommed the Venkman debugger [mozilla.org] (or Firebug [getfirebug.com], but I've never used it) and Selenium [openqa.org]. Venkman (and, apparently, its heir, Firebug) provides a real, honest-to-goodness debugger that supports breakpoints, watchpoints, stack traces, etc. Selenium is a tool for running unit tests within all of the major browsers and it can be automated. (In a past life, I had a script that fired up a virtual X server, launched IE through Wine and ran tests on my app through Selenium. I plugged this into cron and had regular reports of the output emailed to me.)

    Ian

  • Re:Netbeans (Score:2, Insightful)

    by krelian ( 525362 ) on Tuesday May 08, 2007 @11:16PM (#19047579)
    I never really understood all the hate for Netbeans. Maybe it's part of the "hate Sun" heritage.
  • by mabinogi ( 74033 ) on Wednesday May 09, 2007 @03:27AM (#19048883) Homepage
    Javascript has always been object oriented - it was influenced by Self, which is effectively a classless implementation of Smalltalk. Just because you don't understand Javascript, doesn't mean it's not object oriented.

    Javascript is a pretty awesome language once you strip out all the web browser DOM stuff. I've used it as an embedded scripting language in my own applications and was very surprised by its capabilities.
  • by groomed ( 202061 ) on Wednesday May 09, 2007 @03:34AM (#19048927)
    Not really. The SWF file format is open, and there are quite a number of quality open-source Flash development tools. There is no open source Flash runtime which is as good as the Adobe runtime, but then there is no Java runtime which is as good as Sun's runtime either.

Living on Earth may be expensive, but it includes an annual free trip around the Sun.

Working...