Java For Stand-Alone Applications
Java programming language was primarily developed to deal with embedded applications. But with the introduction of Swing and other user interface utilities to Java, it made its mark in desktop applications too. Now the trend is to use Java technology in developing large web and enterprise applications. Java is more focused on web then desktop applications.
But, in this article, we are going to discuss how useful Java is as a development technology for stand alone desktop application development in present scenario.
Java is Suitable for Desktop Applications
There are several applications built on Java technology. Development tools like Eclipse is one the popular example among them. From enterprise applications, Lotus Notes is another good example of desktop Java applications. Such examples show that Java can be used extensively to develop desktop applications apart from installation run times and splash screens. Let us first examine what Java can offer and what are the benefits of using Java as development technology for stand alone applications.
Independence of Java
The most hyped and important feature of Java technology is that it can be used on any platform and on any operating system. Java Virtual Machines are developed for almost all types of hardware and operating system including high-end servers to small palmtop computers and mobile phones. A program written in Java programming language can be executed anywhere provided the Java runtime is available to understand the Byte Code of Java. This feature adds a great value to Java as a development technology for desktop applications. A developer can use the Eclipse application on different operating systems including Window, Linux and Mac Os. This means that desktop applications developed using Java can be used on multiple platforms and multiple operating systems without or with minor changes to it. This saves great amount of development time. Moreover, developers of the application need not worry about operating system implementation of user interface or file management or any such operating system specific feature. Such things are taken care by Java transparently. Some people have wrong concept that developing Java applications is very complex, but features of Java technology actually make development process easier and faster.
Security
From the beginning, Java is known as secure development technology. For stand alone applications, security features are more important. There are applications developed in programming languages that are native to operating system and are found shipping viruses. In this area Java is much secured and reliable technology. Java virtual machine itself intercepts all calls made to operating system from the application – weather it is to establish network connection or to print a file or to access a file from file system of operating system. Moreover Java applies restrictions on access of operating system resources and enables developers to make sure that the applications is not going to harm operating system or any system resource any way.
Manageability
Java is almost pure object oriented programming language (why I am using here the word "almost " because there is a debate going on if Java is purely object oriented or not but that is out of scope for this context). So being an object oriented programming language it is easier to manage than process oriented native languages. Features of Java language like reusability, polymorphism, plug-ability, declarative-ness, configurability makes it most maintainable language.
Pluggable User Interface
There was a time when Java language was much criticized for it’s being poor in look and feel area. But, with the introduction of lightweight Swing components in Java and emergence of reusable JavaBeans, has made Java bounce back in market for developing competitive user interface. Most advantageous feature of Swing technology is that look and feel of the entire application can be changed at fly (at runtime programmatically). This feature is often used to give user freedom to choose from pluggable look and feels (currently three choices are available).
Open Source
Being an open source technology, Java is free to use even for commercial purpose. This way, in order to develop application over the top of Java technology one does not needs to spend money after licensing (unlike native languages). This feature is important in developing desktop applications within a limited budget. Similar features which can be achieved with native languages can also be achieved using Java technology along with developing the application economically.
Remote Access
Reusability of Java objects is one of the well-known features that Java offers. Additional to reusability, Java also offers remote access to object by Remote Method Invocation and CORBA. Using RMI, the developer can access Java objects that are residing on remote host(s). This architecture makes it possible to reuse objects implementing core business logic of the application. RMI also is extensively used to develop LAN applications.
CORBA is a language independent technology that is widely supported and used in Java technology. Using CORBA, developers can access Java objects from other language programs like Cobol, C, C++ and vice versa.
Networking Features
One may be surprised to see this topic here when we are discussing about stand alone applications. But it happens sometimes that stand-alone desktop applications need to access data from network host or internet. In such a case Java has network utilities which facilitates to establish connections to such hosts and access data in a standardized and secured manner. Here we have to remember that before establishing network connection Java checks for security first.
But Beware
There are some points and areas where one has take extra care while developing stand-alone desktop applications using Java technology. As per the above discussion we have understood that Java can be suitably used for desktop application development. But no one is perfect in this world and Java is not an exception here. Let us discuss areas where developers have to take care.
Performance
Here we have to understand that applications developed with Java technology have one more layer to pass to execute any call then those with native languages. The reason is, Java Virtual Machine first interprets Byte Code (compiled Java code) and converts it into instructions which can be executed by operating system. But in case of native languages, they do not need such intermediate interpreter. For this reason, applications developed with native languages can deliver better performance then those with Java.
Modern Java compilers use batches to interpret Byte Code and also other methods are used to improve performance of JVMs. Using such JVM helps developers to achieve very good performance in Java applications also. Moreover, modern processors and other hardware are so efficient that they can easily cope with such performance overhead. Also there are some best practices used worlds wide in Java applications aimed to fine tune performance of Java applications. Usage of such practices and conventions may help in improving performance of Java desktop applications.
And also the way Java makes application easy to maintain and scale after development of application adds a lot of flexibility to the application. This advantage can easily take over the performance disadvantage of Java applications.
Complexity of Development
Another area where extra care is required is the complexity of Java language itself. Experience says that native languages are simpler and easy to implement because operating system comes with in-built support to such languages. But in order to develop applications using Java technology, one has to have good knowledge of object oriented programming and language itself. Also, sometimes complexity of development means more development time, which in turn means increased costs. One has to keep in mind that selection of Java as a programming language is due to its cost effectiveness. It should not add cost to project indirectly by taking a lot of time to develop the application.
The first requirement to develop desktop applications with Java technology is that the application should be well designed. The architecture of the application, layers of control, flow of control, usage of advanced features of Java technology etc should be decided in advance of development to take full advantage of the technology. Complexity of the language can be easily overcome by proper design and architecture of the application. These limitations does not mean that Java is not suitable technology for developing stand-alone desktop applications, Complexity of the development should be avoided by following best practices and proper design.
Summary
From the above discussion we can safely summarize that Java is suitable technology to develop stand-alone desktop applications for different operating systems. Even in areas like maintainability, scalability, security and networking, it is far ahead of native programming languages. Also modern hardware and new Java run times are ready to cope with performance drawback of Java language which makes it one of the most suitable desktop programming languages.