如何命名類似工廠的方法? - How to name factory like methods?

問題:

I guess that most factory-like methods start with create .我猜大多數類似工廠的方法都以create開頭。 But why are they called " create "?但是爲什麼它們被稱爲“創建”? Why not " make ", " produce ", " build ", " generate " or something else?爲什麼不使用“製作”、“生產”、“構建”、“生成”或其他東西? Is it only a matter of taste?這只是口味問題嗎? A convention?公約? Or is there a special meaning in "create"?或者說“創造”有什麼特殊含義嗎?

createURI(...) 
makeURI(...)
produceURI(...)
buildURI(...)
generateURI(...)

Which one would you choose in general and why?你一般會選擇哪一個,爲什麼?


解決方案:

參考一: https://en.stackoom.com/question/E8Ny
參考二: https://stackoom.com/question/E8Ny
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章