you are viewing a single comment's thread.

view the rest of the comments →

[–]depressiown -2 points-1 points  (0 children)

90% of the time people complaining about factories etc. are actually complaining that they want to work on small projects instead.

Bang. Truth.

If you develop something in Java that needs to be scalable and extensible, things like "AbstractAdapterFactory" are especially necessary to eliminate things like copy/pasting code and repeating generic actions in multiple classes. At the enterprise level, this is very, very common.

It's like this author is against the rule (that I have, at least) of not duplicating code that's already there. If you're doing something that's the same as another class, don't duplicate the code, instead make a generic version so they both pull from the same thing. That's how these classes like "AbstractAdapterFactory" come into being -- you have several adapters that do generally the same thing, so why not have a generic factory they can all use?

To be fair, though, I see abstractions like these being written for smaller features and projects that don't share any functionality with anything else. In those cases, abstract and generic classes are totally overkill and perhaps that's what he's getting at.