Java 'Prototype' pattern - new vs clone vs class.newInstance

前端 未结 6 983
别那么骄傲
别那么骄傲 2021-02-08 18:11

In my project there are some \'Prototype\' factories that create instances by cloning a final private instance.

The author of those factories says that this pattern prov

6条回答
  •  死守一世寂寞
    2021-02-08 18:50

    No.

    Oh, I need more characters for an answer. So let me expand and say that such micro-optimization is inappropriate unless there is a problem, and if there is, then you should be in a position to measure if it makes things better.

提交回复
热议问题