开发者

Where to place joining classes?

开发者 https://www.devze.com 2023-01-14 09:00 出处:网络
Abstract example: If I have a system with domains of \"Fleet\" containing a \"Vehicle\" class, and \"Customers\" containing a \"Driver\" class, where would you place a joining class (which would detai

Abstract example: If I have a system with domains of "Fleet" containing a "Vehicle" class, and "Customers" containing a "Driver" class, where would you place a joining class (which would detail lifecycle, insurance claims, and other information about the relationship)? Fleet and Customer concerns are equally important to the syst开发者_C百科em and views on the relationship from both directions will be made.

Fleet.DriverHistory?

Customers.VehicleHistory?

MyVagueGeneralRelationshipNamespace.VehicleDriverHistory?

Other?


I don't think it needs to be a Vague relationship. The vehicle allocations may be "abstract" in the sense that you can't touch them, but in a business sense they are "real", in fact they are pretty much the whole reason for the business. So I'd have a domain "Rental" or some such, which can have your two histories.


I think some kind of record class independent of both two classes is definitely the way to go, ie

MyVagueGeneralRelationshipNamespace.VehicleDriverHistory

0

精彩评论

暂无评论...
验证码 换一张
取 消