【发布时间】:2023-03-17 08:19:01
【问题描述】:
命名基类的推荐方法是什么?是在类型名称前加上“Base”还是“Abstract”,还是只在其后加“Base”?
考虑以下几点:
类型:ViewModel 例如MainViewModel,ReportViewModel
基类:BaseViewModel 或 ViewModelBase 或 AbstractViewModel
同时考虑:
类型:Product 例如虚拟产品,过期产品
基类:BaseProduct 或 ProductBase 或 AbstractProduct
你觉得哪个更标准?
class Entity : EntityBase
{
}
或
class Entity : BaseEntity
{
}
【问题讨论】:
标签: c# naming-conventions base-class