關於使用者註冊系統的Refactoring(重整)過程

kkjvk12發表於2002-09-19
  public void update() throws Exception
  {
    if (newpassword == null || newpassword.equals("") || newpassword2 == null     || newpassword2.equals("") || !newpassword.equals(newpassword2))
    {
        throw new Exception("something wrong with new Password maybe not
       same!");
    }

    AuthorizationIF auth=AuthorizationFactory.getInstance();
    auth.updatePassword(userid,newpassword);
  }

  /** 獲得忘記的密碼
  * @param email
  * @return String password
  */
  public String getMypassword(String which) throws Exception{
    AuthorizationIF auth=AuthorizationFactory.getInstance();
    return auth.getPassword(email);
  }


其中的AuthoriztionIF只是一個介面,他能實現updatePassword和getPassword的功能。這一點我在jive中也看到了,不知如何?

相關文章