オンライン学習システムのRecordControlクラスを含むシーケンス図とその実装例
public class RecordControl{ public boolean canRegist(int year,int month,IEmployee employee){ MonthlyRecord record = RecordManager.getMonthlyRecord(year,month,employee); return(record.getState() == MonthlyRecord.RECORD_INPUT); } }
オンライン学習システムのMonthlyRecordクラスのステートチャート図とその実装例
public class RecordControl{ public boolean approve(int year,int month,String id,IEmployee employee){ return record.setState(MonthlyRecord.PERMISSION); } }
※オンライン学習システムのEmployeeViewクラスのlogin()メソッドのアクティビティ図とその実装
public class EmployeeView{ public void login() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); EmployeeControl control = new EmployeeControl(); MenuView menuView = new MenuView(); while(true){ System.out,println("IDを入力してください。"); String id = br.readLine(); System.out,println("パスワードを入力してください。"); String password = br.readLine(); boolean isAuthorized = control.login(id,password); if(isAuthorize){ IEmployee employee = EmployeeManager.getEmployee(id); SessionManager.setEmployee(employee); menuView.selectFunction(); SessionManager.setEmployee(null); }else{ System.out.println("IDまたはパスワードに誤りがあります。") } } } }