哪个是更好的方法延迟加载问题
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