What’s the difference between a factory method and a constructor?
#1
I’m trying to understand when to use a factory method in my code instead of just a constructor. I keep seeing it in patterns, but in my current project, a simple class with a constructor seems to work fine for creating objects. I’m not sure what specific problem the factory method solves that I’m missing.
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: