05 November 2009

Nearly missed OpenFest

A colleague of mine sent this link today http://openfest.org/. I've missed it last year and I am not sure if I can make it this year again, but yet there seem to be some interesting things to see and hear.

The program is available here. A couple of things caught my eye : a Flex presentation, a practical comparison between different DB engines, Open source SOA presentation etc.

There is also a sale discount on O'Reilly books, check the full list here.

It'd be a good conference to visit.

01 November 2009

Java2Days (Day 2, morning)

Spring and JBPM

The presenter on this topic was Josh Long, a well respected speaker, author and entrepreneur, a lead engineer of the SpingSpurce dm Server.

"… a UML process state is typically displayed in as a transaction in a UML activity diagram …"

Josh started by explaining that process state should not be kept as a property in the entity beans of an application. The reason they do not belong there is that they do not describe our business objects, but rather they describe the state of the business process and thus they belong to a higher (or just different) layer of our code.

"… BPM was, as you might suspect, not originally a technological discipline …"

Another interesting thought was that BPM is (or at least should be) a very good way of collaborating between developers and business analysts.

"… anything that has more than one step could be a business process"

One of the most interesting thoughts was that BPM is best at just keeping the transactional state and more importantly it allows temporal decoupling. This last statement is a food for thought – if a BPM does not in fact work that way it might be poorly designed or not suitable at all. Also one other thing mentioned is

"… the state of BPM today is broken …"

Why? No worklist for each actor in the UML diagram for instance.

".NET also uses Windows Workflow – if it is good enough for them it is good enough for us, right?"

There are also many open source solutions : Spring has an extension called Spring Workflow and jBPM is a part of JBoss's EAP. JBPM is very lightweight, and as easy to you as dropping a WAR file. It could also be used as a Hibernate transactional source.

If you are interested in this topic try reading Josh Long's article.

Also some examples here:



J2EE portability

As much as Alexis Moussine-Pouchkine (a member of the Glassfish team and a person with over 10 years of work experience at Sun Microsystems) tried to make this a "general" presentation it still remained a very hard-core Glassfish propaganda. I must say he had some interesting stories about porting different J2EE applications and, as one might suspect, the task was not as trivial as it sounded. Many issues could come up such as:

  • Packageing and classloader issues – you probably know there is no strict policy on how each application server loads its packages and this might prove to be a problem whenever you need to load your packages in a certain order.
  • Shared libraries location and usage
  • Manifest description – most servers actually ignore any dependencies described in the MANIFEST.MF file
  • Specific to each application server optimizations are not portable at all

A very interesting tool that might help you understand the level of portability of your application is the Java EE Verifier (a part of the Glassfish distribution, but might be used separately). It is extremely useful especially when there is a very good continuous integration strategy as it runs checks and produces reports with warnings. It might also be run as an ANT task and be used the same way FindBugs is used for instance. Yet another thing in my TO-CHECK list.

Advanced Apache Wicket

My personal favorite speaker in this conference – Andrew Lombardi, whose professional career and experience speaks a lot for himself, presented some hands-on experience using the Apache Wicket technology. Unfortunately I was not able to visit his first presentation (which was going through the basics of Apache Wicket) and I was not able to grasp much of what he really wanted to show. Nevertheless he was able to quickly convince me that in an universe of UI frameworks Apache Wicket is worth giving a try.

"… jetty, log4j, apache wicket – all that is required to use Apache Wicket"

Simplicity being the main aim the framework requires nothing other or fancy to run than a simple servlet container and some logging utility. What made a very bad impression to me personally was the fact that the HTML files need to be inside of the binary / source code (no physical separation between the two). I am not sure if this can't be avoided though.

Now the good part comes. Apache Wicket is a lot like SWING (or SWT for that matter) – very easy to use, especially if you have some experience with the former two technologies.

" … see Wicket is SIMPLE … "

Very easy (or at least this is how it looked) 3rd party integration (such as SWF files, though no other technology was actually presented other than that). Another very interesting thing is that Wicket also provides its own unit testing framework, which is a great relief for every team that considers quality a very important goal. Be careful though – executing these tests is not actually taking place in the same renderer, but instead in another test renderer. So if you want to be 100% sure you would still need some way to make functional (and probably automated) tests. But as Andrew said :

"… if you worry about having 98% of test coverage … you probably have other problems to worry about …"

And finally if you are interested you can visit http://wicketbyexample.com

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)