JAVA design pattern study