Tuesday, November 20, 2007

Spring 2.5 is out

Spring 2.5 is out, and it introduces several new exciting features. One of the most exciting features in the new version is the java configuration, and automatic discovery of spring beans. Well, since the beginning of the Spring framework, wiring components to each other and configuring which class will be injected where was done only using XML. Yes, the people behind spring always said that any format can be used to do the configuration, but you have to write your own classes to implement the format you are going to use. Hence, there was nothing but XML until today.

As of now, you can use the auto-wiring features provided by the new version of spring to put the wiring configurations as annotations in your java code. You will still be using XML, but the amount of XML you need to write will be reduced significantly. Mark Fisher wrote a great article on InfoQ titled What's New in Spring 2.5: Part 1. Looking forward for part 2.

Saturday, November 17, 2007

Politics in Software Development

Politics is present in every aspect of our life, whether we realize it or not. It's present in the way you treat your family, your in-laws, and your coworker. It's even present in software development.

Ever wonder why Microsoft made Windows Mail in Vista not able to have Hotmail (now Windows Live Hotmail) accounts (unlike Outlook Express), and then months later they release Windows Live Mail which has this feature? Haven't you ever thought why when you want to download the new version of MSN Messenger (now Windows Live Messenger), you have to download an installer which has the options of downloading several other new Windows Live products that you never heard of (Mail, Writer, Photo Sharing, etc)?

Why does Microsoft's Windows Live Family Safety require that each and every member of your household should have a windows live ID so that he/she can access the internet? You say marketing? I say marketing falls under the umbrella of politics.

If the above examples don't strongly show clearly how company politics affect software development, the following ones will certainly do so.

Sun's business is mainly hardware, servers to be specific. Sun is also the company that maintains java. Now java is supposed to be platform independent, and we (java developers) claim that it runs on each and every availabal platform, right? WRONG! Sun creates JDKs and JREs for Windows, Linux and Solaris only, meaning that if you have an HP or an IBM server, you will not be able to get Sun's JVM. HP and IBM develop their own JVMs, but of course the available Java version on those machines is always behind that of Sun. Currently, HP and IBM have JVMs that run java 5, which is more than three years old.

Sun simply won't release versions of java for AIX or HP-UX since it will be releasing it for competitors in the hardware business. If it did, enterprises that have java applications and need to use the latest features may go to Sun's competitors. Sun releases versions for Windows to stop Microsoft from dominating the software development market, and if this is done, the market share of dot net will increase while that of java will decrease, and since dot net doesn't work on anything other than Windows, Sun will be losing a large part of the hardware market for windows based servers.

Sun also open sourced it's star office suite to create openoffice.org, and they open sourced Solaris, and made it compatible with desktop and laptop hardware. Why? To go another step in stopping Microsoft Windows from dominating the desktop market, so that it would slow down the growth of the dot net community, so that software in the market would be runnable on UNIX and not just Windows, so that it would increase it's the possibility of people going for Sun servers.

I believe that Sun's war with Microsoft could simply be over (or at least won't be as strong) if Microsoft made dot net platform independent, but Microsoft will never go for such a move. Microsoft wants to dominate the desktop environment with Windows, and it's very strong competition from Apple and Linux. Microsoft is using the dot net technology, with their fabulous IDE to market Windows. If suddenly dot net applications ran on Linux, for example, Microsoft may lose a huge market share.

I think that projects like WINE must make Microsoft live in fear. Maybe that's why Microsoft made a lot of changes to Vista that made a lot of programs not compatible with it. What had happened is that the software vendors made their software compatible with Vista, and everything went back to normal, except that projects like WINE and REACTOS went one step behind.

I believe that a lot of changes that were introduced to Vista were just to make it incompatible with such projects (such as changing "Documents and Settings" to "Users" and a lot of folders under the user folder like "Local Settings" for example to "AppData\Local" or something like that, and a countless more changes). I believe that such changes have no meaning other that what I assumed earlier.

Now let's go back to Sun again. Sun is THE supporter for Netbeans, which is a great IDE by the way. On the other side of the table, we have the more popular Eclipse, and guess what, IBM led the Eclipse Consortium (and it's the one that created Eclipse). Now someone would say that both are open source projects, and it doesn't make a difference to the companies what IDE developers use, right?. I again say WRONG!

IBM is in the software business, and being familiar with Eclipse makes you somewhat familiar with Websphere and Rational Tools, that are built over Eclipse. Being familiar with those IBM products may lead to you using the Websphere application server, and if you do, which operating system and hardware are the best for such a server? IBM hardware and AIX is the answer. What was Sun's response? Open source Sun application server and create project glassfish, hence you have a high end application server from Sun for free, and of course it supports the latest java technologies months (or even years) before other application servers (like servlets 2.5, JSP 2.1 and other JEE 5 features for example).

Back to Netbeans and Eclipse. Both IDEs allow developers to create custom plugins, but Eclipse recently (not very recently, actually about a year and a half ago) changed their framework to use Equinox, which is Eclipse's implementation of OSGi. OSGi is maintained by a large group of corporations, that include both IBM and Sun Microsystems, and both were founders of the OSGi Alliance. Having IBM and Sun working together is not something to be surprised from, because, as I mentioned before, it's all about politics.

Now Eclipse implemented OSGi by creating Equinox, what will Netbeans do? Well, as an active member of the Netbeans team told me once, they are waiting. They already have their pluggable framework. If they go to OSGi, they have to choose an implementation, and for sure they won't use Equinox. Even if they go for any other implementation (Apache Felix or Knopflerfish for example) or even create their own, they would still be switching to OSGi after eclipse did, hence Netbeans would be following Eclipse's steps (or as someone else would be seeing it, Sun would be following IBM's steps).

So, what's next? Well, there is a JSR (JSR 277) which was created to create Java Module System, which is very similar to OSGi, and guess what, IBM is not in the expert group. As I mentioned seconds ago, the Netbeans team is waiting to see which one will win, Java Modules or OSGi, but I reckon that they will either go for Java Modules once the JSR is finalized, or they will stay as they are. I'm quiet confident that they will never go for OSGi.

I believe that this post became much longer, than I wanted it to be, but I can still go on with the subject for much longer. I wanted to get to a point, and that is, politics between large companies have a great effect on software development. Even with open source projects, when a project becomes very popular, large companies tend to create standards similar it. Examples in java include log4j & JDK 1.4 logging, Hibernate & JPA and of course OSGi & java modules (OSGI and java modules have some differences of course). It's then up to the original creator of the open source project to implement the standard (like hibernate implementing JPA).

I'm not at all against Sun (actually I'm a huge fan), but I took it as an example. I'm also not against standardization. I just wanted to speak about the subject of why large corporations do what they do.

Edit on 12/12/2007
HP released java 6 in November and IBM release java 6 just this month, which is still two years after the release by Sun.

Saturday, November 10, 2007

Logback web configurer for Spring

On thing that should be mentioned about logback is that spring doesn't have a ConfigListener for it like the one it has for log4j (the org.springframework.web.util.Log4jConfigListener class). Well, you can write your own code based on the spring source. Thankfully to Davide Baroncelli, he already did that for us. He had already sent the code to the logback user mailing list. The the thread is available online on Nabble, so that if you would like to view it. He also has an updated version that supports auto reloading for logback configurations. Thanks Davide