We have been making some changes to the user interface of a project of which I'm a member. This requires me to change some automated user testing APIs and interfaces to match the new reality.
I don’t remember exactly who I was talking one day when they mentioned my use of the @Override annotation even when implementing interfaces. I told them the IDE added that, and I just left it at that. I couldn’t think of a great use case for that being there at the time, but since the IDE did it for me I figured there must be some point even in the case of interface implementation, so I left it in the code as it didn’t cause any issue and was correct logic.
Now that I have begun to refactor and remove some methods which no longer make sense, I am finding the @Override annotations very useful because the IDE points out what is implemented as an @Override when it isn’t actually overriding anything from a super class or interface. This is a compile time error, and were I not using a fancier IDE, I would still be alerted to the problem when the project was compiled. Thus, the annotation has been a nice aid in this type of refactoring.
This would also be the case of an actual method override in the case where the super method was not called from the override. In such a case, and without @Override, the logic would simply no longer be used, but would compile just fine. The call would be removed from calling code of the super class or interface for the obvious compiler reasons one would encounter, but if someone left that logic in the existing class by mistake, and someone thought it should be called because some other state depended on it without that class being rethought at the time of some major refactoring, then a serious issue has been introduced which could be hard to figure out.
I wanted to share this with everyone as I believe it can help everyone if @Override is always used. If you have a different opinion or thoughts on the topic please share.
This is my blog for software development. I am a professional software engineer. I work on various projects. I also contribute to open-source projects such as www.netbeans.org
2011-01-28
2008-11-03
openSuSE 11, Sun VirtualBox, Windows XP, and OpenSolaris
I upgraded my laptop from openSuSE 10.3 to 11.0, and I must say that I really like it. It has many small improvements, but most importantly I have not had to decompile and compile my own ACPI DSDT, it actually hibernates correctly, and just works with the Toshiba hardware. See my 10.3 post for my issues with this laptop.
The one draw back was I went with KDE 4, and while it seems a really awesome desktop function wise, it's stability left a horrible taste in my mouth. So, I decided to give Gnome a try after all these years of being a big KDE fan. I really like Gnome 2.2, but I'm not sure if I'll keep using it or go back to KDE 3.x and wait on KDE 4 to catch up.
In my previous setup I was using VMWare Workstation 6.0 (which I paid over a couple hundred dollars). I really liked it function wise, mostly. The main draw back is it wasn't really kept up to date to run on newer kernels shipped with Linux distros such as openSuSE and probably even Fedora. At least I couldn't find the updates, and I was having to resort to hacking the source code to get it to build against my kernel. So, I gave Sun's VirtualBox a try, and I must say that I've been very impressed with the overall performance and Linux distro updates, but there are a few things it needs to do better.
VMWare Workstation will let me use multiple monitors just like X. In other words (see my screen shot) I literally have two separate screens which I may drag windows across. A single desktop with two monitors. Pretty common indeed. Well, VirtualBox doesn't support this. The best it can do is have a single window non-full screen stretched across my multiple monitors. Not so great (horrible actually). See my screen shots from the 10.3 and VMWare post to see what I mean; check out Vista.
ALSA sound support is very choppy. I don't know what the deal is, but VMWare had this issue too though my other applications such as Firefox, Banshee, etc are fine. Right now, what VMWare couldn't do, I'm using OSS for sound, and this is a little better, but it gets choppy when I try to use something like Napster and play my music from Windows.
Seems networking is easier in VMWare. This is probably due to custom network drivers which VirtualBox doesn't have, so VirtualBox can't easily, and independent of the network interfaces, setup standalone network interfaces. Now, it wasn't such a big deal to setup VirtualBox from a networking perspective, but I venture to say those newer to Linux or Unix will have a harder time getting VirtualBox working than VMWare if they need to go beyond NAT.
In my setup my virtual machines have their own IP addresses. This way they act as true independent computers when I need them for testing etc, and this makes network shares and other necessities much easier to use. Anyways, I had to setup a bridge, disable NetworkManager, and do some things by hand versus using the GUI. Having to disable NetworkManager means using wireless networks will now be harder as I have to use the keyboard versus a UI, but as I've used Linux for years it is not that much harder for me.
USB interfacing seems to be harder. I haven't gotten this setup yet, but I haven't really needed it yet, so I haven't done much digging. Regardless, it isn't working out of the box where as VMWare did. In VMWare I could just connect a USB device, connect it to the virutal machine with the UI, and I was using it without the need for any extra dependencies in the OS. Seems VirtualBox has some dependency I'm missing from my openSuSE installation.
OK, screen shot time. In this screen shot, I'm running two monitors, one with 1440x900 resolution, and the other with 1680x1050. I can full screen a virtual machine on either monitor, and after I install the virtual box extensions into the guest operating systems they can resize their resolutions to fit the resolution of which ever monitor I happen to be running or the size of the Window in which they're running. At least this is true for Windows. In this screen shot, I'm updating Windows XP to service pack 3, installing OpenSolaris 2008.05, building a NetBeans 6.5 daily build, and browsing the openSuSE online store. Enjoy.
The one draw back was I went with KDE 4, and while it seems a really awesome desktop function wise, it's stability left a horrible taste in my mouth. So, I decided to give Gnome a try after all these years of being a big KDE fan. I really like Gnome 2.2, but I'm not sure if I'll keep using it or go back to KDE 3.x and wait on KDE 4 to catch up.
In my previous setup I was using VMWare Workstation 6.0 (which I paid over a couple hundred dollars). I really liked it function wise, mostly. The main draw back is it wasn't really kept up to date to run on newer kernels shipped with Linux distros such as openSuSE and probably even Fedora. At least I couldn't find the updates, and I was having to resort to hacking the source code to get it to build against my kernel. So, I gave Sun's VirtualBox a try, and I must say that I've been very impressed with the overall performance and Linux distro updates, but there are a few things it needs to do better.
VMWare Workstation will let me use multiple monitors just like X. In other words (see my screen shot) I literally have two separate screens which I may drag windows across. A single desktop with two monitors. Pretty common indeed. Well, VirtualBox doesn't support this. The best it can do is have a single window non-full screen stretched across my multiple monitors. Not so great (horrible actually). See my screen shots from the 10.3 and VMWare post to see what I mean; check out Vista.
ALSA sound support is very choppy. I don't know what the deal is, but VMWare had this issue too though my other applications such as Firefox, Banshee, etc are fine. Right now, what VMWare couldn't do, I'm using OSS for sound, and this is a little better, but it gets choppy when I try to use something like Napster and play my music from Windows.
Seems networking is easier in VMWare. This is probably due to custom network drivers which VirtualBox doesn't have, so VirtualBox can't easily, and independent of the network interfaces, setup standalone network interfaces. Now, it wasn't such a big deal to setup VirtualBox from a networking perspective, but I venture to say those newer to Linux or Unix will have a harder time getting VirtualBox working than VMWare if they need to go beyond NAT.
In my setup my virtual machines have their own IP addresses. This way they act as true independent computers when I need them for testing etc, and this makes network shares and other necessities much easier to use. Anyways, I had to setup a bridge, disable NetworkManager, and do some things by hand versus using the GUI. Having to disable NetworkManager means using wireless networks will now be harder as I have to use the keyboard versus a UI, but as I've used Linux for years it is not that much harder for me.
USB interfacing seems to be harder. I haven't gotten this setup yet, but I haven't really needed it yet, so I haven't done much digging. Regardless, it isn't working out of the box where as VMWare did. In VMWare I could just connect a USB device, connect it to the virutal machine with the UI, and I was using it without the need for any extra dependencies in the OS. Seems VirtualBox has some dependency I'm missing from my openSuSE installation.
OK, screen shot time. In this screen shot, I'm running two monitors, one with 1440x900 resolution, and the other with 1680x1050. I can full screen a virtual machine on either monitor, and after I install the virtual box extensions into the guest operating systems they can resize their resolutions to fit the resolution of which ever monitor I happen to be running or the size of the Window in which they're running. At least this is true for Windows. In this screen shot, I'm updating Windows XP to service pack 3, installing OpenSolaris 2008.05, building a NetBeans 6.5 daily build, and browsing the openSuSE online store. Enjoy.
Subscribe to:
Posts (Atom)