May 24

Imagining a method which receives as a parameter a type Object instance and needs to perform some action according to its type is not difficult. In fact, there are several design patterns that, when used in combination, help solve just that. However, this post is about adding a new switch..case construct to prevent some boiler-plate caused by these patterns.
Continue reading »

Share/Save/Bookmark

May 19

Whenever a class in my model contains a collection which requires that particular care be taken with its items, there’s an internal debate regarding how to expose it to other classes. And with this, there are two major schools: one, the paranoia-based approach which doesn’t allow external code to touch the collection’s internal items and two, the trusting approach which just returns the collection for everyone to deal with.
Continue reading »

Share/Save/Bookmark

May 11

The Garbage Collection set of posts (Generations, Parallel and Concurrent, Tips and Memory Leaks) are ones that I am personally very proud of. First, they were very interesting to write, as the material is extremely interesting; second, a lot of people seemed to enjoy them, and found interest in reading them; and third, it seems that the first post was the most read post in the blog since November ‘07, and that’s even more remarkable when considering that the post was published on December!

Because of the last reason, which showed me how much people love the garbage collection subject, I’ve asked my sister to draw a little comic panel discussing the issue. I find it amusing; my sister’s partner found it tragic. I wonder what you think of it!
Continue reading »

Share/Save/Bookmark

Chaotic Java is Digg proof thanks to caching by WP Super Cache!