How to name factory like methods?

后端 未结 11 1894
别跟我提以往
别跟我提以往 2021-01-29 19:41

I guess that most factory-like methods start with create. But why are they called \"create\"? Why not \"make\", \"produce\", \"build\", \"generate\" or something el

11条回答
  •  再見小時候
    2021-01-29 20:24

    Factory method doesn't dictate on method name. You can have as many methods you want in your factory, provided all of them return the object from same family.

    For more details, visit the url http://xeon2k.wordpress.com

提交回复
热议问题