Thursday, February 18, 2010

Annotations - Good, Bad, or Ugly?

In my workplace, we are currently in the process of moving towards JDK 1.5 (I know, we're not on the cutting edge of technology, with many apps still on JDK 1.4 and even 1.3).

As such, I am finally taking the time to dig into some of the newer Java features. Annotations are one item that was introduced with JDK 1.5 (or I guess its called Java 5 now) that I haven't made up my mind about yet.

Annotations, simply put, are a facility within Java for providing meta-data about code. From what I can tell so far, there are a couple different flavors (or uses) for this meta-data:
  • documentation (acting essentially as a form of structured comments within the source code)
  • compiler information (to provide a little clearer instructions to the compiler about how to handle the code - things like @Deprecated, @Override, @SuppressWarnings are all pretty clear in what they are telling the compiler)
  • specialized processing (I suspect that this will more likely be used by frameworks, etc.)
In fact, my main exposure to annotations so far are from the Spring documentation (can you tell that I'm a fan of Spring?) It seems to be a way to remove some of the restrictions based on naming conventions, as well as a means of simplifying the XML configuration files (which I admit can get cumbersome).

I can see some advantages for using annotations, but I can also see it getting easy to mix in environment specific or configuration information that really shouldn't be embedded in the code.

More to come on this topic, but to answer the question posed in the title of this blog, I suspect its going to be like many other technologies - has some benefits when used properly, but can be easily abused (or used for the wrong reason).

Friday, February 5, 2010

Oracle + Sun = ???

I know that this whole thing started long ago, and there's been a lot said (and written) about this topic, but I still haven't made up my mind about the overall impact. Particularly on Java - which is near and dear to my heart. Their main emphasis so far seems to be on the fact that they can now offer the full stack; from low-level hardware to software, including multiple enterprise applications spanning several verticals. But what is this going to mean to the peons that are still in the trenches, slinging code every day?

On the one hand - we now have a company with deep pockets and the ability to invest in Java as a platform. Oracle is saying that they plan to hire close to 2,000 people, many of which are expected to be technical (engineers, etc.). You might expect this to create significant growth in Java, along with better (and simpler) integration with all of the software/tools/frameworks already under the Oracle umbrella.

They are also pledging "certified" systems and unique support opportunities, where there is only "one place to call' to resolve issues. While this all sound great in the board room, how is this going to translate in the real world?

Well, I don't have the answer to that, other than to say that the only certainty is that things will change. Particularly in areas where there is clear overlap between the Sun and Oracle offerings, things like:
  • Development tools - I don't see JDeveloper and NetBeans co-existing (and Oracle has made no secrets about sticking with its "own" tools as the strategic direction for most products).
  • Application servers - While GlassFish is touted as the reference implementation with and "enterprise-ready" feel, it pretty clearly overlaps the current Weblogic offering.
  • Database servers - Clearly, no one expects MySQL to just go away, but its hard to know how that will play with product that drive Oracle's rise, their own flagship database.
There are other cultural differences that may play into things too - regarding open source directions, Java Community Process, and general approach to innovation Sun had more of a history of supporting projects that looked innovative, regardless of whether or not they would lead to real revenue. While this may have been a factor in their demise, I still am concerned about the prospects of losing choices in these areas.

I guess we'll just have to wait and see what the future brings, but if history is any indicator, I don't think the change will happen overnight. These things always take time...