Equality vs Identity

When storing objects in a Set, it is important that the same object can never be added twice. That is the core definition of a Set. In java, two methods are used to determine whether two referenced objects are the...

Get rid of equals, compare_To and to_String

Have you ever looked at the javadoc of the Object-class in Java? Probably. You tend to end up there every now and then when digging your way down the inheritance tree. One thing you might have noticed is that it...

Definition of the Trait Pattern in Java

In this article I will present the concept of traits and give you a concrete example of how they can be used in Java to achieve less redundancy in your object design. I will begin by presenting a fictional case...

Using Traits in Java 8

In one of my earlier articles I mentioned a programming component called “traits”. These constructs have existed for many years in other programming languages like Scala and PHP, but have only recently been available through default methods in Java. I...

Building Reactive Systems with JavaFX

JavaFX is the new standard library for building graphical applications in Java, but many programmers out there is still stuck with Swing or even (tremble) AWT. A lot has happened in the 20 years java has been around. When I...