| Java on Windows Live :) Java Tips and Tricks - Alpha | | Hosting a web site that talks about Java on WindowsLive site is a bit ironic - but it's free for now, so why not! Anyway, instead of blogging on blogger.com, I decided to setup a web site and show samples of code for some of the hot-topics in Java, such as NIO, file-based transactional system, concurrent programming etc. Yes, yes, I know there are many sites about Java, but surprisingly, stuff that you will find here, will be very hard to find elsewhere! |
| |
| | Rants [Mar 2008] Got Open Source?Is open source finally paying up? It seems that big companies are finally after open source. Acquisitions of open source companies have doubled in 2007. In January of 2008 Sun dished 1B for MySQL. Everybody is now looking at Mozilla. It is estimated to be worth between 1.4B and 4B. I am wondering, how do you handle the transition? If you are open source company (like Mozilla) who has many developers contributing world-wide, and you go public, do you start paying those developers? Or will they simply stop contributing? If they stop contributing, what's going to happen to the company? And more importantly if I contributed some code to Mozilla, now Mozilla goes public, am I entitled to some shares? [Sep 2007] Sun announced that it will ship Microsoft Windows on it's servers. WOW! What happened Scotty? When I was at Sun, you needed special permit to get access to Windows. Now Sun is going to ship it? To me this just proves Sun has no ideas and is not a visionary company that gave us Java. Speaking of Java, I am woried what's going to happen to it. I know Java is open source and IBM also has major Java distribution, but, unless you are running WebSphere, most of the time you are running Java from Sun. With Sun shipping Windows, what is next? Java, that is not free and open?  If you are using Java to deliver web applications, usual "three tier" apps you probably never needed something like this. However, if you are writing servers or services using Java, it is likely that you needed to create/change/delete/move multiple files around. To ensure that the operation is not partly done, you need a transaction. One approach to file based transactions is described here. New IO in Java is a set of APIs that allow faster access to files using memory mapping and native code as well as API for non-blocking sockets. To learn more about these features check out this link where I write about common misconceptions and issues with the NIO server implementation. Following this design will produce fast scalable NIO server that can handle thousands, if not tens of thousands of concurent connectinos. In many Java applications i18n just happens. We use resource files, to localize the presentation and never worry about character encodings. However, if you have to process double-byte characters by reading them from some file, you need to make sure you use proper character set encodings if you do not want to be dependent on the underlying operating system. It is simple to do, once you do it. Read about it here. Every serious application should use logging. System.out.println should be strictly forbidden for logging. Why? Well, to start with it is at least 5 times slower then, for example, log4j. I find log4j a necessesity on every project. Every time I start new project I think about using latest java logging, and every time I somehow give up. Log4j interface is so simple, straeight-forward and efficient that I just cannot bring myself to abendon it. In this entry, I write about simple do's and don'ts with log4j logging. 
| |