I should have used a factory method instead of a constructor. Can I change that and still be backwards-compatible?
The problem
Is there a factory pattern to prevent multiple instances for same object (instance that is Equal) good design?
I have a number of objects storing state. There are essentially two types of fields. The ones that uniquely define what the object is (what node, what edge etc), and the others that store state describing how these things are connected (this node is connected to these edges, this edge is part of these paths) etc. My model is updating the state variables using package methods, so all these objects act as immutable to anyone not in Model scope. All Objects extend one base type.
Is a Factory class still a Factory class if the objects it returns already exist?
I can’t decide what to name my class. So far I’ve labelled it up as a Factory, but I am not sure.
Does this factory method pattern example violate the OCP?
In Head-First Design Patterns, they use a pizza shop example to demonstrate the factory method pattern.
Differentiating between Factory Method and Abstract Factory
I’ve been confused for a while about the differences between the patterns Factory Method and Abstract Factory. Been doing a lot of research, still confused.
Differentiating between Factory Method and Abstract Factory
I’ve been confused for a while about the differences between the patterns Factory Method and Abstract Factory. Been doing a lot of research, still confused.
When is it worth NOT using a Factory?
I’m employing TDD quite a bit these days and really enjoying myself – everything seems to flow better and be naturally better constructed and organized. However, while writing a bit of IO code, utilizing System.IO.Stream
s, and I was wondering – when is it ever worth not using a factory? Because in Stream
s case, it certainly seems better to not use a factory.
When is it worth NOT using a Factory?
I’m employing TDD quite a bit these days and really enjoying myself – everything seems to flow better and be naturally better constructed and organized. However, while writing a bit of IO code, utilizing System.IO.Stream
s, and I was wondering – when is it ever worth not using a factory? Because in Stream
s case, it certainly seems better to not use a factory.
When is it worth NOT using a Factory?
I’m employing TDD quite a bit these days and really enjoying myself – everything seems to flow better and be naturally better constructed and organized. However, while writing a bit of IO code, utilizing System.IO.Stream
s, and I was wondering – when is it ever worth not using a factory? Because in Stream
s case, it certainly seems better to not use a factory.
When is it worth NOT using a Factory?
I’m employing TDD quite a bit these days and really enjoying myself – everything seems to flow better and be naturally better constructed and organized. However, while writing a bit of IO code, utilizing System.IO.Stream
s, and I was wondering – when is it ever worth not using a factory? Because in Stream
s case, it certainly seems better to not use a factory.