我手头有一个场景,正在进行一些设计讨论.用简单的话来区分它,考虑一个层次结构就像这样的公司----->客户------>订单(忽略订单如何产品的细节等)如果我要公开一个API与此合作,什么是更好的设计.
一个)
Dim comp As New Company comp.GetInfo(123) Dim cust As New Customer cust.Name= "CustomerName" comp.Add( cust)
b)
Dim custhand As Customerhandler Dim cust As New Customer cust.Name= "CustomerName" custhand.AddCustomer(cust,123) ''123 is CompanyID
Chris Simpso.. 8
我会和(A)一起去,但我会倾向于改变......
Dim comp As New Company comp.GetInfo(123)
成...
Dim comp As Company = Company.Get(123)
(因此向Company类添加新的共享方法以返回Company的特定实例)
我会和(A)一起去,但我会倾向于改变......
Dim comp As New Company comp.GetInfo(123)
成...
Dim comp As Company = Company.Get(123)
(因此向Company类添加新的共享方法以返回Company的特定实例)