public class ViewLogic { public void view(Auth auth) { UserOperation ope //操作クラスを設定 switch (auth) { case ADMIN: ope = new AdminOpe(); break; case VIEWER: ope = new ViewerOpe(); break; } ope.閲覧(); } } /** * 登録処理クラス **/ public class RegisterLogic { public void register(Auth auth) { UserOperation ope //操作クラスを設定 switch (auth) { case ADMIN: ope = new AdminOpe(); break; case VIEWER: ope = new ViewerOpe(); break; } ope.登録(); } }