Three Layer demo in Java