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-20 9:16

>>11

Confession: I don't use decorators, not because they aren't useful, but because they scare me and boggle my brain. I'm just an amateur, really, and I learn programming concepts a little bit at a time as they become something I *observe* happening within my own code.

In the particular case of my current project, they don't actually seem to be necessary here because what I'm actually doing is a very simple mapping of my properties between two classes, the "storage" one and the "living" one. Everything is very predictable in that environment. I was, earlier, doing a project where it was going from "storage" to "anything" which I stopped before I had very much in the "anything" part. Had I added a lot I think I can see where the decorator pattern might have become useful; decorating would have greatly decreased the amount of duplicate code by letting me say something like "do the standard init for this type of object, and then also do this other thing which is more special-case," but I hadn't gotten there; I was using simple inheritance mostly and letting stuff be rewritten fairly frequently.

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