Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有完全返回全新对象的方法的命名约定?
“产生” ?“创造” ?
它可以Create像@David 建议的那样,或者GetNew像 GetNewProduct() 那样。我更喜欢 GetNew,因为Create更多用于工厂方法,GetSomething用于普通对象,然后GetNewSomething强调实际上正在创建一个新对象。
Create
GetNew
有任何公开的 Microsoft 推荐的约定。