Constructors or Static Factory Methods?

I believe Joshua Bloch said it first in his very good book "Effective Java": static factory methods are the preferred way to instantiate objects compared with constructors. I disagree. Not only because I believe that static methods are pure evil, but mostly because in this particular case they pretend to be good and make us think that we have to love them.

[image error]Extract (2009) by Mike Judge

Let's analyze the reasoning and see why it's wrong, from an object-oriented point of view....

 •  0 comments  •  flag
Share on Twitter
Published on November 13, 2017 16:00
No comments have been added yet.