Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Factory classes

Name: Anonymous 2005-11-17 4:09

Can somebody explain what are factory classes good for? As in, "why all this shit"? I have the impression factory classes are yet another suit in the Emperor's wardrobe. To me, they always looked like some bored programmer who needs to keep his job and hates the KISS principle decided to make our lives worse.

Name: Anonymous 2005-11-17 5:27

Generally speaking, they are useful in cases where you want more flexibility in creating instances than you get with the language's built-in construction operations (i.e. "new").

E.g. if you want a function that creates different subclasses of a  common parent depending upon its arguments, or if you want to easily create lots of very similar instances of a very generalised class.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List