Over a million developers have joined DZone.
Platinum Partner

Java Enterprise and Desktop: Spot The Difference

· Java Zone

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.

The two main branches of Java development, Enterpise and Desktop, have traditionally been seen as separate skill sets. But some current trends are contributing to blurring the line between the desktop and the web.

For years I've been working on desktop Java with Swing and with the Eclipse platform. I've regarded JEE development as a separate activity, targeting the web market.  Some changes in the industry have led me to question this assumption.

What is an Enterprise Application Anyway?

Before we discuss why desktop and enterprise Java aren’t all that different, we should look at what defines an application as an enterprise application 

  • An application that involves the integration of many resources
  • An application with high performance requirements
  • Scalable, secure and robust
  • Easy to maintain and extend
  • May run across a network
If you look at what you are writing at the moment, I'm sure it must tick at least 3 out of the 5 points above. I would go as far to say that it covers almost 80% of all applications currently being developed.
The important thing to take from this is that whether you are developing for your application server, or for your desktop environment, chances are you are developing an enterprise application.

Signs of a Welcome Change 

Analysts at Gartner Group, writing in the report Trends in Platform Middleware state something that has been quite obvious from the past few years of enterprise development, often quoted by Rod Johnson.

The popular Java Platform, Enterprise Edition (Java EE) and .NET platform middleware technologies are increasingly inadequate to cover needs for extensive scalability and performance, event-based programming styles, advanced service-oriented architecture (SOA) and dynamic application developments.

When the original J2EE architecture was defined, it tried, but failed to predict the future.  By attempting to cover all cases, including more than its fair share of “what-if” scenarios, it became an overwhelming specification.
Trends over the past few years have seen a rise of innovation in the open source community, giving us frameworks such as Spring and  Hibernate, each dealing with a particular piece of the jigsaw. In particular, OSGi has given the chance to produce properly dynamic applications.

Each of these frameworks can run as standalone on a desktop, or deployed on an application server.  This lack of dependency on the application server gives the freedom to use the same approaches on different platforms.

The Desktop Moves to the Web

So far we’ve seen that the enterprise applications are becoming more lightweight and more modular thanks to Spring and OSGi. Integration with key third party APIs is easy thanks to the rise of open source.

One of the most interesting trends in the past year has been the ramping up of the effort to move desktop quality software onto the web browser.
Appcelerator’s Nolan Wright, notes that his RIA development platform will be making a move towards better desktop integration in a recent interview.

We see the next big thing for us being desktop integration, but not at the expense of the browser. We want to have the power of the web in a desktop container, where we get to use features like drag n drop and saving files locally. Adobe AIR is already making progress in this area.

With the expected spotlight to be on JavaFX at this year's JavaONE, we can see that Sun recognizes that we need to have a useful presentation layer for many target platforms. Google’s GWT API has been written to closely mirror what the Swing API looks like. Developers who previously thought themselves to be pure desktop can now find themselves comfortably developing front ends on either the desktop or the web, thanks to this trend.

Online IDEs have been getting a lot more coverage, and are seen as one of the next big things. Eclipse has been making some moves towards this web-enabled future with the announcement of e4, and we can expect to see a lot more companies looking at this convergence of the web and the desktop.
IBM’s Mike Wilson, leader of the Eclipse Platform project, explains why this change in focus needs to happen for Eclipse.

I think it's very important for the Eclipse code base to move out to the Web, and get involved more in that space, because the world is changing. A lot of business software development is moving to Web-base UIs backed by services. We're also seeing the IDE world moving in that direction.


The Part OSGi has to Play

This move to service based software has many implications, not least a better, more modular design. It’s a natural evolution for software development to take, and helps to make the field more mature.

OSGi plays a central role in this modular approach, providing a dynamic component model. As an example, Eclipse provides the Equinox OSGi framework, which can run in many modes – standalone on any JVM, as part of an Eclipse RCP application or to even deploy the Equinox WAR file on your Java EE server.

Ian Skerrett, Director of Marketing for the Eclipse Foundation specifies the problem that the OSGi approach will solve.

In Java we have SE (Standard Edition) and ME (Micro Edition) and EE (Enterprise Edition). These all require different models. It's portable, but not properly consistent.  Infrastructure technology needs to be a lot more adaptable.

It is fair to say that OSGi is one of the most important enabling technologies to get us to this goal of a better infrastructure where we just choose our target platform and deploy accordingly, rather than having to create separate projects to deal with different environments.

What This Means for the Industry

So how does this affect a daily developer's life? For a start, it's time to break down any barriers and pre-conceptions that you may have about either desktop or enterprise developers. To survive in the industry of the future, and I'm guessing around two years time here, we need to be able to work with both streams.

Desktop developers need to ramp up on JEE skills - perhaps even looking at the older J2EE approaches to full appreciate the technologies provided - it's much more than just technologies for the web. On the other hand JEE developers need to familiarize themselves with the traditional user interface technologies such as Swing and SWT. At some point, we'll find a nice middle ground, but this knowledge will help us shape a better future for the Java applications we write.

So, what do you think - have you seen this trend happening already where you work? Are there cases where we can't think of enterprise and desktop as the same thing?

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}