There's a common idiom in Java for writing the equals() method. Straight from the classic book, "Effective Java", it looks like this:
public boolean equals(Object obj) {
if (this == obj) { return true; }
if (obj instanceof ThisClass == false) { return false; }
ThisClass other = (ThisClass) obj;
return this.importantField1.equals(other.importantField1) && this.importantField2.equals(other.importantField2);
}
When using Hibernate, particularly with lazy proxy classes, it's important that you stick to this idiom!
Continue reading "Equality for Hibernate" »
Joel's busy complaining that teaching Java in comp-sci courses makes life too easy for people, because they don't have to deal with pointers and recursion. News flash for you, Joel: the times have changed, and new tools are available.
Continue reading "A recursive descent into pointless debate" »
Martin Fowler just wrote an entry on implicit interfaces. This actually would be very useful, but I think I can see why language designers wouldn't adopt it (at least, not outright).
Continue reading "Implicit interfaces" »
I'm considering buying one of those thar MacBook Pros, but at a base price of AU$3199, it's a little pricy. Now, Apple has a long-standing reputation of charging premium prices, but seeing as how the MacBook is Intel-based, it should be possible to do some good price comparison.
Dell has released the new Inspiron 9400, which is also based on the Intel Core Duo chip. So, we can do a comparison that is better than Apples to Oranges on this.
Continue reading "Has Apple reached price parity for their laptops?" »