10 October 2009

Java2Days Conference (Other topics from day 1)

Java and the cloud

Presented by John M. Willis, a cloud computing evangelist and CEO of his self funded Zabovo Corporation. For those of you who do not know what cloud computing is I'd highly recommend reading about it in Wikipedia http://en.wikipedia.org/wiki/Cloud_computing. Basically this is the concept of higher abstraction – you can start by abstracting from something like the infrastructure (using some sort of virtualization for instance), through platform abstraction (when you do not really care whether or not you are running on windows or not … oh wait … we do care, so never mind) and even application abstraction, where you just want a place were you can deploy your code (such as Google Apps).

As you might suspect this is quite a large topic. One thing caught my eye though and it is called Hadoop (http://en.wikipedia.org/wiki/Hadoop). Check it out – it does some pretty amazing things.

Modular Dynamic Web Applications (using OSGi)

Our presenter was Rob Harrop, a lead engineer of SpringSource dm Server, author of several books including Pro Spring, a member of JCP and is involved in the JSR-255 expert group for JMX 2.0. Pretty impressive, right?

His presentation was also quite impressive – he showed the audience how an application could be split into several smaller components using OSGi. What we could see is how we could achieve absolute encapsulation – each bundle would have its own interface and their clients (the other bundles that use them) would have absolutely no way of knowing or directly using their implementation. Of course there is even a way to have more than one implementation of a given bundle and load them depending on a certain rule.

Want more cool? Here it comes : imagine you have two bundles that make up your web site – a hotel reservation and airline reservation part. You could actually remove one of them and the other would work just fine. If you make a request to the removed one (say hotel reservations) the OSGi framework would stall the request a given predefined amount of time, waiting for you to actually insert this bundle back in. You would however be surprised to find out that in order for this to actually work you should have split your logic in two (implementation and interface). If you were to simply put back the missing bundle it would have other class version even though it is the same bundle. So in order to make this work the missing bundle should be referenced by its interface package.

I didn't manage to ask about class versioning though. What would happen if you remove a bundle and you have some thread running on of its classes in the same time? Would it be forced to stop? And what if the old version of the class references methods / classes that are no longer there in the newly introduced bundle? Will have to find out this myself ...

Java2Days Conference (Java EE 6 Preview)

Raza Rahman presented this topic. For those of you who are not familiar with his work he is an independent consultant specializing in Java EE, he is also co-author of the EJB 3 in Action from Manning, a frequent speaker at conferences and finally an independent expert in the Java EE 6 and EJB 3.1 expert groups.

As we all know Java has been around for over a decade and this is somewhat unusual for a software platform. It withstood the test of time, but in order to do so in the future some fundamental changes should be introduced. And so the turning point is the newly upcoming Java EE 6 release. What this means is that the platform would have:

Pruning – the concept removing all the legacy APIs from the platform (of course we are talking about deprecation here!) or as Mr. Rahman said:

"… there is a bunch of APIs that don't really make sense today… "

  • JAX RPC superseded by JAX WS
  • EJB 2.x and Entity Beans superseded by JPA
  • JAXR, UDDI (not really utilized the way they should)

Profiles – intended to produce different subsets of the Java platform. Currently there are only two profiles (the full bundle and the web profile). 70% of the web applications would only require the web profile as they are not much less than a database front end with very simple business logic. This totally makes sense to me – I was long hoping for the time when you could actually have different bundles of Java. I never really used most of what the J2EE bundle offered.

Content and dependency injection – a type-safe, built-in dependency injection with automatic context management, able to provide a binding point between frameworks like JSF, JPA and EJB. It really looked charming, but unfortunately I was not able to find much about it anywhere.

JSF 2.0 – the long awaited burial of JSP is finally here, facelets being it's successor. JSF 2.0 should be entirely annotation driven (no more nasty .xml files) and should also offer AJAX support for the JSF life-cycle. Sound too good to be true, really.

EJB 3.1 – I was never a very good enterprise specialist but this sounded really interesting to me. The new standard would provide :

  • Singleton beans with concurrency model (not meant to be some sort of services)
  • Cron style timers
  • Asynchronous bean invocation
  • Simplified WAR archives creation
  • Java SE support
  • And EJB lite (can's say much about that)

JPA 2.0 – which I personally consider the crown jewel. JPA 2.0 would provide many enhancements such as:

  • ORM enhancements (particularly the ability to map collections)
  • Query and entity manager enhancements
  • JPQL enhancements
  • The addition of a type-safe criteria API that even allows you to model the actual SQL statement
  • Pessimistic locking, second level cache etc.

Servlet 3 – another thing I personally like a lot. It uses annotations form ground up (hell we should simply all admit we hate XML). This, of course, would mean that the web.xml file now becomes optional. The API would have what they call "intelligent defaults" to settings not provided by the annotations. And something I especially liked – servlets would also become managed beans, allowing, for instance changes to their behavior at run time. By accessing the context we could programmatically "deploy" and "undeploy" servlets whenever there is the need to do so.

The 6th revision would also provide APIs for RESTful web services (JAX RS) providing an alternative to SOAP. Why do I have the strangest feeling this would be the next thing I have to migrate? Damn if I am right… And lastly there will be a centralized bean validation mechanism that would allow us to specify constrains once across the whole application.

I am sure this is only a portion of what the new release would have and I have probably missed some of the things presented, but still it is a rather exciting list. For those of you who can actually read specifications you can try reading http://jcp.org/en/jsr/detail?id=316 . Me personally – I will wait for a pioneer like you to make a nice and verbose example, like "the X steps you would need to take in order to start using the new X API". Hey, don't blame me, it is your fault. If you weren't writing all these tutorials I wouldn't have become so lazy and degrading!


Another thing - you can read the whole presentation on Java EE 6 here.

Java2Days Conference (intro)

The first Java conference was held in Sofia and with much success as far as I am concerned. Several internationally recognized speakers such as Reza Rahman, John Willis and Rob Harrop spoke on topics like the upcoming Java Enterprise 6 release, Spring, OSGi, cloud computing, EJB 3, GWT etc. Much to hear and much to see, but unfortunately I am just a man so I only visited part of the sessions, bitterly swallowing the disappointment of missing some of the most interesting ones.

I must admit that the organization was not that bad, there were some issues to note, but as a whole the conference was a huge success. Especially when you consider the total lack of any alternatives (well I have visited the WebTech conference but they are not really comparable).

I'd like to mention some of the topics that caught my eye in my next few posts. I will not go into much detail (mostly because I am not sure if I can). I hope somebody finds them useful J

09 October 2009

Здравей свят!

Or "Hello world" in Bulgarian.

For any poor soul reading this - welcome to my newly created, fresh and yet untainted professional blog. I will be constantly boring people with topics such as development patterns, tips and tricks, interesting findings, new (and old) technologies, strange and even bizarre code snippets and poor developer jokes (are there any other?).

Topics that would follow in a day or two:
  • the Java2Days Conference held in Sofia
  • some thoughts on the latest topics in Josh Long's blog
  • my favorite type of deadlock (I promised myself to write about it, although it is really nothing extraordinary)