Category Archives: java

Google’s cut-down Java: wanton and irresponsible, or just necessary?

Sun’s Simon Phipps stirred things up last weekend when he called Google’s actions wanton and irresponsible. Its crime: delivering a cut-down Java library for use on its App Engine platform, “flaunting the rules” which forbid creating sub-sets of the core classes.

It does sound as if Google is not talking to Sun as much as it might. Still, let’s note that Google has good reason to omit certain classes or methods. App Engine is a distributed, shared environment; this mean that some things make no sense – for example: writing to a local file – and other things may be unacceptable, such as grabbing a large slice of CPU time for an extended period.

Salesforce.com addressed this same issue by inventing a new language, called Apex. It’s Java-like, but not Java. The company therefore avoided accusations of creating an incompatible Java, and conveniently ensured that Apex code would run only on Force.com, at least until someone attempts to clone it.

Google’s approach was to use Java, but leave a few things out. This FAQ gives an overview; and the article Will it play in App Engine lists common frameworks and libraries with notes on whether they work. Given that languages like JRuby, Groovy and Rhino work fine, it’s clear that core App Engine Java is not too badly damaged. The big omissions are JDBC (because you are meant to use the App Engine datastore, which is not relational), and Enterprisey things like JMS, EJB and JNDI. Google is nudging, or shoving, developers towards RESTful APIs along with its built-in services.

Will you be able to escape App Engine if you have a change of heart after deployment? I’d guess that porting the code will not be all that hard. Perhaps the biggest lock-in is with identity; you could roll your own I guess, but Google intends you to use Google accounts and supplies a Java API. Microsoft is ahead of Google here since it does support federated identity, if you can get your head round it: you can authenticate users in the Microsoft cloud against your own directory using Geneva. The best Google can offer is Directory Sync; though even that is some protection from identity lock-in.

Java support on App Engine is actually a vote of confidence in Java; if what is good for Java is good for Sun, then Sun is a winner here. That said, just where is the benefit for Sun if companies host Java applications, built with Eclipse, on Google’s platform? Not much that I can see.

Technorati Tags: ,,,

Tim Bray’s contrarian views on Rich Internet Applications

There’s a though-provoking interview with Sun’s Tim Bray over on the InfoQ site. One of his points is that Rich Internet Applications aren’t worth the hype. He says that web applications are generally better than desktop applications, because they enforce simplicity and support a back button, and that users prefer them. He adds:

Over the years since then I have regularly and steadily heard them saying: "We need something that is more immersive, more responsive, more interactive". Every time without exception that somebody said that to me, they have either been a developer or a vendor who wants to sell the technology that is immersive or responsive, or something like that. I have not once in all those years heard an ordinary user say "Oh I wish we go back to before the days of the web when every application was different and idiosyncratic … ".

In further gloomy news for advocates of Adobe Flash, Microsoft Silverlight or Sun’s own JavaFX he adds:

I suspect that the gap in the ecosystem that lies between what you could achieve with Ajax and what you need something like Flash or JavaFX or Silverlight to achieve is not that big enough to be terribly interesting.

I think there is a lot of truth in what he says, and I still regularly see Flash applications or Flash-enabled sites where I wish the developers or designers had not bothered. Nevertheless, I don’t go along with it completely. I’m typing this post in Live Writer, a desktop application, when I could be using the WordPress online editor. The reason is that I much prefer it. It is faster, smoother, and easier to use.

Another example is Twitter clients. I use Twhirl though I may switch to Tweetdeck; both are Flash (AIR) applications running as it happens outside the browser. I’d hate to go back to interacting with Twitter only through web pages.

I agree there there is some convergence going on between what we loosely call Ajax, and the RIA plug-ins; Yahoo Pipes apparently uses the HTML 5 Canvas element, for example, using this Google Code script for IE support. I’m glad there is a choice of RIA platforms, but I don’t see either Flash or Silverlight going away in the forseeable future.

It’s worth recalling that the RIA concept began with the notion that a rich user interface can be more productive and user-friendly than an HTML equivalent. I’ve written a fair amount about the legendary iHotelier Broadmoor Hotel booking application which kind-of kicked it off – and I’ve interviewed the guy who developed it – and it was undoubtedly motivated by the desire to improve usability. As far as I can tell it achieved its goals, which were easy to measure in that online bookings increased.

Multimedia, rich visual controls, Deep Zoom, offline support, pixel-level control of the UI; there’s a lot of stuff in what we currently call RIA that is worthwhile when used appropriately.

Another twist on this is that RIA is enabling a more complete move to web applications, by reducing the number of applications that do not work either in the browser, or as offline-enabled Flash or Silverlight.

Still, Bray is right to imply that RIAs also increase the number of ways developers can get the UI wrong; and that in many cases HTML with a dash of Ajax is a better choice.

I think the RIA space is more significant than Bray suggests; but his comments are nonetheless a useful corrective.

QCon London 2009

I’m at QCon London and covering it on Twitter as wi-fi and battery power allows. The focus of the conference is enterprise development, and it spans Java and .NET, SOAP and REST, but with a bias towards Agile methodology.

I was here last year, and my observation is that last year there was considerable angst about the idea that the SOAP stack was failing to deliver and that new stacks based on REST were the thing to do.

This year this same statement feels more widely accepted and people are moving on, based on that assumption.

One delegate stuck his hand up and asked, “is this a fad, or will it last”? Sounds like a cry of pain from someone who invested heavily in something now condemned. History tells that in five or ten years time we may well be equally enthusiastic about some new thing and observing all the weaknesses in the bad stuff we used to do.

Still, these trends don’t form overnight. We have to choose what looks like the best model at the time.

I’m typing this during a session on test-driven development. Personally I think TDD is a more profound improvement in the software development process than REST vs SOAP; the detail of TDD will continue to evolve and be debated; but its basic ideas are hard to challenge.

As an aside, this is one factor in why ASP.NET MVC is so important for developers on Microsoft’s web platform. Reason: it’s testable.

Have you seen a real JavaFX app yet? Sun’s misleading 100 million claim

I haven’t – only samples and demos. Which makes Jonathan Schwartz’s claim of 100,000,000 downloads, presented as “JavaFX Hits 100,000,000 Milestone!”, suspect. Still, I reckon there is an easy explanation. JavaFX is now included with the JRE, the standard Java runtime download. So what Schwartz means – please correct me if I am wrong – is that there have been 100,000,000 downloaded updates to the JRE (no doubt partly thanks to Sun’s auto updater on Windows), since JavaFX became part of it.

In order to test this theory, I fired up a virtual machine (using Sun’s excellent Virtual Box) which runs Vista but does not have Java installed. Then I went to Java.com and went for the free Java download. At the end of the install, I saw this dialog:

Note: it says “The JavaFX runtime will be downloaded when you click Finish”. There are no buttons aside from Finish, unless you count the close gadget. Therefore, I got JavaFX by default with the JRE.

I have nothing against JavaFX, but meaningless PR spin will do nothing to help the technology.

Technorati tags: ,

Top ten sites where developers hang out

Someone asked me today where developers hang out on the Net. Excluding platform-specific sites like MSDN, here’s my first go at a top ten list, in alphabetical order – but I’d love to hear other suggestions.

 

Coding Horror Jeff Attwood’s site. Both Attwood and Spolsky are on the Stack Overflow team

DzoneDIGG for developers, also includes Javalobby, which was set up on a wave of indignation back in the nineties when Microsoft seemed to be endangering Java’s run-anywhere promise, now a general Java discussion site.

Joel on Software I don’t always agree with Joel Spolsky, but he’s an excellent writer and deserves inclusion if only for his piece on leaky abstractions.

Reddit programming – another DIGG for developers, actually I prefer this one to Dzone

Slashdot – Geek news discussion site, not just for developers though you’ll find plenty of them there. If you need to know the meaning of the site name, you are outside the target readership.

Stack Overflow – community question and answer site for developers, mentioned by everyone when I asked about developers’ favourite sites on Twitter.

The Code Project – masses of code samples, mainly .NET but also Java, SQL, Linux

The Daily WTF – where WTF stands for “Worse than failure”, allegedly

The Register – IT news site willing to “Bite the hand that feeds IT”, includes a developer section. Disclaimer: I am a contributor.

TheServerSide which has mainly Java but also a .NET site, both geared to enterprise development. Seems less busy of late.

 

Other developer haunts I considered:

DaniWeb – IT discussion community with an active software development forum

DeveloperFusion – based in the UK, developer-focused articles, blogs and resources

Dr Dobbs – web site for the best software development magazine, docked several points for ad videos that auto-play when you visit

Rick Strahl’s web log – where you go to discover what really works or does not work in ASP.NET

SDTimes – web site for a family of Software development magazines, some good articles but not really a community

 

Update: Other sites I probably should have included:

InfoQ – developer-focused articles, Agile/Enterprise focus, sponsor the excellent QCon conferences

JavaFX warns against itself on Macs

If you navigate to JavaFX.com on a Mac, you get this warning – at least, I do, and so does at least one other:

In case you can’t read it, it says:

This applet was signed by “JavaFX 1.0 Runtime,” but Java cannot verify the authenticity of the signature’s certificate. Do you trust this certificate? Click Trust to run this applet and allow it unrestricted access to your computer.

I trusted it anyway. Why? Mainly because it is on Sun’s site, and I doubt Sun was hacked. Second, because I clicked Show Certificate and it said everything was fine. Third, because on balance I think it is more likely that either Sun, Apple or a.n.other messed up either the cert or some other aspect of digital security programming, than that this particular bit of code belongs to a bad guy.

Nevertheless, I mention it because it illustrates the continuing hopeless state of Internet security. How on earth am I meant to know whether I should trust a certificate that “Java” has rejected? Who is this Java guy anyway? Why should I give any applet “unrestricted access” to my computer?

I see this all the time. We are confronted with impossible decisions, where one set of training tells us to click No – the certificate is out of date, the application is unsigned, the requested permissions are unwarranted – and another set of training tells us to click Yes – this is a reputable site, I need this installed to get on with my work, I’ve seen dialogs like this before and not come to any harm.

It might be better not to have the choice. In the scenario above, if the applet just refused to run, then there is a better chance that the problem would be treated as a bug and fixed. As it is, there is little chance that we will always guess right.

Technorati tags: , , ,

JavaFX code runs at the speed of Java

The Java runtime used by Sun’s JavaFX is mature and well optimized, which means that non-visual code will generally perform well. I’ve just spotted that Josh Marinacci at Sun put up a version of my countprimes test to illustrate this. Here’s the JavaFX version. On my system JavaFX and Silverlight are neck-and-neck for this – sometimes one is faster, sometimes the other. Flash is much slower, and Javascript not in the race.

Next stop: an Alchemy version.

Sun’s JavaFX is launched: another go at applets

Sun has launched JavaFX.

 
Sun’s Eric Klein, VP of Java Marketing, explains JavaFX

What is it? Sun says:

JavaFX is a rich client platform for building cross-device applications and content. Designed to enable easy creation and deployment of rich internet applications (RIAs) with immersive media and content, the JavaFX platform ensures that RIAs look and behave consistently across diverse form factors and devices.

What is it really? A new script language called JavaFX; a compiler that turns JavaFX script into Java bytecode; a runtime that includes new media codecs; converters that turn SVG, PhotoShop or Illustrator graphics into JavaFX format. JavaFX also requires the JRE (Java Runtime Environment). Currently only Windows and Mac OS X are supported; Linux and Solaris support “will be provided in a future release”; mobile is also on the way, promised for Spring 2009.

A variety of video and audio codecs are supported, but unfortunately these vary by platform. For example, WMV plays only on Windows; H.264 runs on Mac but on Windows only “as an update”, whatever that means. However, there is a specific “cross-platform” codec, which is VP6 from On2. Snag: you need On2’s commercial software to convert to the required .FXM format.

What’s good about JavaFX? Sun claims broadest market reach; but this is nonsense – I presume it is counting every device with a smidgen of Java installed. There are some advantages though. JavaFX can run Java code, and there’s plenty of that out there. The Java VM is mature and fast. A neat feature is that you can run JavaFX applications outside the browser by dragging them onto the desktop. Even in the browser, Java FX are not confined to the browser window, but can create graphics that appear anywhere on the screen. Java SE 6 update 10 or higher is required for these features, which depend on an out of process Java applet plugin in this update.

What’s bad about JavaFX? There are several reasons why Sun will find this a hard sell:

  • Large download size. Flash and Silverlight are self-contained browser plug-ins; Silverlight is larger than Flash, but still under 5MB. I’m not sure exactly what size JavaFX is on a machine without Java. I tried visiting javafx.com on a new XP install, and was directed to the main Java download site which recommended a JRE of about 7MB; I suspect it might do further incremental downloads after that, since the full JRE is more like 15MB. Once the JRE is in, you still need to install the JavaFX runtime, though is done automatically and I imagine that in time JavaFX will just be part of the JRE. Right now, the process is less smooth than for Flash or Silverlight.
  • Lack of design tools. Adobe has its fantastic Creative Suite, most of which now seems to target Flash. Microsoft has Expression. Sun is offering converters for Photoshop and Illustrator or SVG. These applications know nothing about JavaFX, and there is no visual editor in NetBeans 6.5.
  • A new language. Although JavaFX script does not look particularly difficult to learn, it is friction for developers wanting to give it a try.
  • Signs of haste. I’m seeing this now. When I saw the JavaFX announcement, I went to the site and successfully installed the runtime and played the introductory video, which itself uses JavaFX. Soon after, presumably as word spread, the launch site became unusable for me. Videos do not play; samples do not download. The spin will be that this shows the high level of interest; but vendors like Sun are meant to understand about scalability.

     
    JavaFX.com showing signs of stress on launch day

  • Late to the party. Adobe is well entrenched with Flash. If Microsoft is late with Silverlight, Sun is very late with JavaFX.
  • Limited features. I’m just back from Adobe MAX, learning about features like Pixel Bender in Flash Player 10, and its new text rendering engine, and new audio API. The JavaFX API looks limited by comparison. There is no 3D support yet.
  • Lack of compelling reasons for adoption. You can run Java code; but then again, Java applets and desktop Java clients have been around for many years. I can see the value in both Flash and Silverlight, but what is the must-have feature of JavaFX?
  • Platform variation. It bothers me that JavaFX supports different codecs on different platforms. What happened to write once – run everywhere?

What else? It’s early days. I’d like to hear from Designers whether JavaFX does what they need. JavaFX will improve, and it does have obvious value for Java developers who want to code rich internet applications. Sun’s commitment to open source may make JavaFX interesting to those who find Flash and Silverlight too tightly locked to single vendors.

Some details above are drawn from the JavaFX FAQ.

Sun’s financial problems – what comes next?

Sun has today published a press release announcing that up to 18% of its global workforce is to be cut and that Rich Green, VP of Software, has resigned.

It has also formed a new business group called Cloud Computing & Developer Platforms, for advancing its cloud services efforts.

Sun is a fascinating company, with serious commitment to open source. It is also the steward of Java, MySQL and OpenOffice.org. Despite the software aspect, selling servers is a core part of its business, and its problems now (in my quick opinion) are a consequence of the economic downturn, a trend towards cheap-and-many in the server market, and a rush towards open source without any clear strategy over how to monetize it. No, I don’t believe turning runtime and application downloads into foistware and adware is the solution.

Somehow, Sun allowed competitors such as IBM and Oracle to benefit from Java without reaping equal rewards itself. It is great at innovating but less good at profiting from its invention. Java applets were the first browser-hosted client applications, but Sun did not see the need for something like JavaFX until Adobe Flash and then Microsoft Silverlight showed how this needed to evolve; now it is probably too late.

Another example is utility computing (one aspect of cloud computing), which Sun pioneered with its Grid initiative; but others such as Amazon are now setting the pace in this area.

What comes next – acquisition, recovery, or continued decline?

Technorati tags: , , , , ,

Sun distributing Microsoft toolbar, Google drops Star Office from its Pack

Microsoft has done a deal with Sun where its search toolbar is distributed with the Java runtime. The deal only applies to US Internet Explorer users who download the JRE. Previously Sun distributed the Google toolbar with Java.

Separately, as one or two have noticed, Google is no longer distributing Sun’s Star Office suite with the Google Pack. Cracks appearing in the Sun/Google relationship?

The Star Office aspect is interesting because it may (or may not) be significant for Google’s overall strategy for productivity software.

Google has its own office suite, one that works online. So why promote a competitor? Well, Star Office is a traditional desktop suite that has more features and works offline. It is also one in the eye for Microsoft and might inhibit a few Office 2007 sales. I had wondered whether Google would try some deep integration with Star Office, where you could seamlessly open and save documents to Google storage on the Internet.

Maybe Google has now decided that Star Office muddies its message, which is a pure Internet play for office applications, with offline features coming via Gears. When combined with the speed of Chrome, this has plenty of potential.

Alternatively, Star Office is just being upgraded and will be back soon. Or perhaps Sun and Google fell out over the terms. Now that Google is so dominant in search, users visit Google and get the toolbar anyway; it doesn’t need Sun’s support. All speculation; Google has yet to comment, as far as I know.

Let me add that I hate this method of promoting software, where you download one thing and get another by default. It’s called foistware.

Technorati tags: , , , ,