Posts Tagged: synchronization

Do We Still Need the Singleton Pattern?

Posted by & filed under , , .

If you have been working in software engineering for a while chances are you have often come across (even if you didn’t know it!) design patterns. If you haven’t, as I said, chances are you just don’t realise you have used them — so I strongly suggest the “Gang of Four” book as a starting […]

Java Strings vs Ropes

Posted by & filed under , , , .

Recently, in my news feeds I stumbled across this implementation of Ropes in Java (http://ahmadsoft.org/ropes/) and it captured my attention right away as it boasts a faster (better?) alternative for dealing with characters in Java. Unfortunately the website doesn’t offer any comparative information regarding how much faster a Rope implementation is than the standard String […]

Playing Around with Buffers

Posted by & filed under , , , .

I found myself recently using the Buffer class in the Apache Commons Collections framework — and realised that the Buffer-related classes don’t get enough coverage as they probably should, since they can actually provide out-of-the-box solutions to common development problems. So I started this little exercise partly to demonstrate some of the powerful Buffer-based classes […]

Simplify Your Singletons

Posted by & filed under , .

I’ve seen recently some Java code (I’m not telling whose, you probably know who you are :p) where a singleton pattern was involved. Nothing unusual here, you would say — and you’re right, I probably found myself using Singleton and Factory and Observer in pretty much every single Java project I ever worked on. The […]

SimpleDateFormat and Multiple Threads

Posted by & filed under , , .

I felt like I had to write this to spread the word a bit more about this little-known danger of one of the JDK classes: SimpleDateFormat. Used quite widely from what I can tell — who hasn’t written something like this: SimpleDateFormat df = new SimpleDateFormat(); df.format( new Date() );SimpleDateFormat df = new SimpleDateFormat(); df.format( […]