Software patterns in Java