I was doing some work on an SDK recently which required that I access a protected member of a class. I didn’t want to have to override the class just to get access to it so I did some digging and discovered some interesting things you can do with Java and the JVM to access not only protected but also private class members.
It made me think a little about how we design classes and assumptions we make about immutability and access to internals. Here I have provided 2 examples of immutable classes. The first is obviosuly not properly immutable simply due to the fact that it’s field is declared protected and not private.
So after some major overhauls I have started using this blog and some other web projects as a way to stay in touch with the web development space.
My commercial development work at S1 is all Java based and seldom has anything to do with web technology let alone a GUI.
So in my spare time I plan to keep this blog updated and try to hone my WordPress skills. I have started a small consulting business on the side to help small/medium companies with general IT stuff. Mostly this has been free advice to friends and relatives but lately I have started trying to provide some basic web and email services to companies that can’t afford the rip-off prices of digital agencies.
I was recently browsing around Facebook and came across an event being organised in London where a bunch of SAffas are getting to gather to protest against the crime in SA. The event has drawn a number of interesting responses, not least from a local blogger who runs the blog SA Rocks.
Nic’s post entitled “Protest against crime in SA to be held in LONDON??” was a stab at these expats getting all fired up about the state of crime in a country they have seemingly turned their backs on. Nic argues that the best way to improve the situation in SA is to be here helping first-hand. The post has drawn quite a long commentary with veritable essays by some visitors, including yours truly.
I have a hosting account with Site5. I must say there service, though sometimes delayed by the difference in time zones, is generally excellent and they have a large community of users in their forums who will often help you out too.
Recently I had a need to not only use php5 but to also install the bz2 php extension on my account. This proved to be an interesting adventure and since I found very little help on the forums and the need was beyond the scope of the support I bumbled along on my own. I used various resources and finally got it right. Here’s how:
P.S. You’ll need Command-line access to your server (eg: via SSH).