Design patterns and sample code for java and javaee