Skip to main content

Posts

Java Persistance

Recently I explored a bit how one can easily make use of the new Java Persistance API. The example below shows how one can very quickly create and search records from a Derby database table called "Course". To keep things simple and at the same time examine exactly the code required for such a task I created a simple console application from my netbeans 5.5.1 IDE. The new persistance API is much lighter than the previous version and was taken out from the Enterprise API thus making it possible to use it from simple java applications. Once I created my console app I added a new "Entity class from Database" to the project. A dialog is displayed and the connection chosen must be previously defined from the Runtime->Databases section in Netbeans. In the dialog I as well chose the option to "Create Persistance Unit" using the Toplink Library and named it "PUnit". Once one goes through these simple steps automatically Netbeans creates an Entity clas...

Swapping two variables without using a third

I came across an interesting algorithm ... the normal way how programmers swap values between two variables is by using a temporary third variable ... temp = x, x = y, y = temp. An interesting trick can actually do the same process without having to use a third variable, and this is done by using the XOR operator. Below I am showing how this can be done in java: public static void main(String[] args) { int x = 15; int y = 20; System.out.println(x+" "+y); x ^= y; y ^= x; x ^= y; System.out.println(x+" "+y); } Try it out !

Java Tech Day in Malta!

Finally the first ever Sun Java Tech Day in Malta. It will definitely be an excellent opportunity for the Java community in Malta to hear leading speakers from the US. Details on the event can be found at http://mt.sun.com/javaday

Worth noting on the radar ... O3Spaces

A product called O3Spaces Workplace is gaining momentum in the collaboration software field. The product is being positioned as a direct competitor to MS SharePoint Office Server focusing on document management and collaboration. The open edition should be available at some point during 2007 both on Windows and Linux platforms. From the available demos and documentation it surely seems to be an excellent competitor for SharePoint bringing in as well nice integration with OpenOffice tools. For further info (and even a vmware image demo) you can find more info at http://www.o3spaces.com

Setup for my development environment

Finally I managed to find the time to complete a proper setup at home. As my server I used Ubuntu 7.04 as a base to host my Glassfish app server, Postgres and other utils. Mainly i use it as a deployment box and for my development i still use my Netbeans on my XP laptop managing all the rest through ssh/psftp over wireless access mainly. Compared to other distributions i found Ubuntu extremely easy to install and driver recognition is one of the best i have ever seen compared to other Linux distributions. Surely sudo and apt-get commands make life extremely easy to install and setup services. In conjunction with the autodeploy function on Glassfish this makes the deployment of war/ear files really easy ... anyways really happy with the environment, the plan is to soon start exposing some utilities from my linux box over the net, will keep you posted.

Lacking creativity ...

Yesterday I visited MCAST since I was one of the judges examining student programming projects. What really struck me is the fact that the majority of projects, although technically sound, didn't really explore any new areas or ideas ... a situation of more of the same. Would have expected much better from young students who were given free hand on the topics or areas to focus on. Although not a teaching expert myself, i think that it is highly important that teachers and the teaching model itself introduce creative thinking methods as part of the IT students curriculum.

SOA, is it a fad?

Now that we have nearly finished our first SOA project using Sun Microsystems JCAPS platform we have some hands-on feel of this latest trend. Being our first project it definitely took more time than expected to deliver the solution (apart from busted weekends) when compared to traditional development approaches, especially when looking at the new rapid application development environments such as Netbeans 5.5. The main advantage we experienced is that by adopting such a solution the end user benefits from a single desktop environment, something that in large organizations can be quite rare in practice. From a technical perspective an SOA solution introduced a standard enterprise platform that can act as the main backbone for application development, transaction management and standard interfacing across multiple heterogeneous backend systems. Our experience so far has showed that SOA has to be seen as a long term strategic decision which can prove to be quite challenging to show immed...