Wednesday 13 May 2015

Platform Independence: Gone Today, Here Tomorrow

  Although Java is technically platform independent, discrepancies still exist between platforms. These differences result from three different mechanisms:
  • Implementation: The hooks from Java to the client machine's operating system are implemented by different teams on each machine. Although they work with a single standard, they introduce different bugs at different times. A particular interface feature that works in JDK 1.0.2 for the Mac might not work in JDK 1.0.2 for Windows, for example, and the bug list for JDK 1.0.2 on Windows is different (and longer) than the bug list for the same version of the JDK on the Mac. The good news is that as Java matures, these types of differences will go away. Check http://java.sun.com/products/JDK/ to find links to the latest information on the current version of the JDK and associated bug lists.
  • Design: Because Java uses the operating system on each platform to provide basic GUI elements (such as buttons), applications and applets look different on each platform. On the Mac, for example, a windows menu bar is placed at the top of the screen rather than in the window. This is very different from what users see on Windows or UNIX machines, but it's what Mac users expect. Although you can control the amount of space used by an item, you can't control the detailed look and feel. These differences are there as long as different operating systems are used. This actually is nice, because your users see interfaces that are familiar to them. Imagine the uproar if you tried to make Mac users live with a Motif interface!
  • Standards or the lack thereof: The Java language standard strives to be complete and unambiguous. Unfortunately, defining a computer language so that everyone who implements it does so in an exactly identical fashion is very difficult. You should expect some ambiguities in the standard; it is interpreted in slightly different ways by the people who implement Java on different platforms. These discrepancies tend to be eliminated over time; the larger the discrepancy, the quicker it is stomped out.
Because you can't really do much about any of these issues, you need to test your projects on as many different platforms as you think they will run on. For applets that are used on the Internet, that means pretty much every platform, whereas for an application running on your company's intranet, it might mean only Sun and SGI. The good news is that for simple interfaces, you'll find that although everything doesn't look identical across platforms, the matchup is pretty good. If you don't have access to multiple platforms, you can be fairly sure that your interface will look pretty much the same on any platform that supports Java.


Note
If the content of the WWW site on which you're going to use the applet is machine specific, you probably don't have to worry about the applet not being pretty on other platforms. If you have a Mac software site, you probably won't get a whole lot of visits from Windows users.

No comments:

Post a Comment