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 01

Time for some refreshing the memory with a Java language feature probably few use, and maybe for a good reason. Suppose you’re running code on elements of an array up until a certain element is found. When your code finds that element, it stops the iteration. Therefore, your code might look like the following:


for (int i = 0; i < array.length && condition(array[i]); i++) {
  // your code here
}

Or, if you’d like to use the new foreach feature, like this:
Continue reading »

Share/Save/Bookmark

Apr 21

For those of you who don’t know what OpenID is, get to know it now. This post is going to be about how to use OpenID authentication in your GWT applications.

First, a reminder of what OpenID is:

OpenID is a free and easy way to use a single digital identity across the Internet.

Continue reading »

Share/Save/Bookmark

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