Jul 26, 2017 · 1 min read
Personally I like the isolation of creation, basically allowing me to quickly swap out or refactor what is happening at the point of creation. It also allows me to isolate what is creating an Object and the usage of new is isolated. I would assume these are the some of the same benefits of any usage of the factory pattern.
I did mean instance of, thanks for the correction. I don’t use ‘instanceof’ but I was stating that it makes it unavailable. However, I was unaware that it has those kind of consequences. Makes total sense that the execution context would negate the equality of a class.