How do you name the "same" entity in different tiers of an application?
You've got an N-tier application which deals with companies, so you've got a table called Company, an object in your DAL called MyApp.DAL.Company
, an object in your application layer called MyApp.Core.Company
, and in your service contract called MyApp.Contract.Company
, and in your client proxy called MyApp.ServiceReference.Company
, and in your client model called MyClient.Model.Company
. You've probably a开发者_如何学Golso got one in your viewmodel called MyClient.ViewModel.Company
.
Questions:
- How do you deal with the boilerplate code that converts from
Company
toCompany
at each layer? - How do you deal with the fact that they've all got the same name? This is a problem in those layers where you have to deal with both (e.g. in the service contract implementation), but also in unit, integration and (less so) system tests.
精彩评论