learn how to use desing patterns in java