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が提案したようにすることも、 GetNewGetNewProduct()のようにすることもできます。私はGetNewを好みます。これは、 Createがファクトリメソッドでより多く使用され、GetSomethingがプレーンオブジェクトに使用され、次にGetNewSomethingが実際に新しいオブジェクトが作成されていることを強調するためです。
Create
GetNew
そのために、マイクロソフトが推奨する公的な規則があります。