哪個是更好的方法延遲加載問題
public class Account
{
public UserAccount GetUserDetails(string acctId)
{
return new UserAccount().GetDetails(); //call method from class UserAccount
}
public UserAccount GetUserDetails(string acctId)
{
return new UserOtherDetails().GetDetails(); //call method from another class
}
}
或包含這樣
或任何其他方法傢伙類?
編輯:如果我在方法上添加參數怎麼辦?
附加:我在這裏的觀點是我不想當實例化我打電話的GetUserDetails方法
這裏沒有足夠的信息讓我感覺舒服的回答。 – 2010-09-12 14:20:37
我很困惑,'userAccount.GetDetails()'返回一個'UserAccount'類型的對象。 GetDetails做什麼? – Heinzi 2010-09-12 14:26:57
請更改您的問題的主題,使其更有意義 – abatishchev 2010-09-12 14:28:15