I have a factory class that currently takes 6 params in it's constructor, and I just hit a need to add another.
Normally, this would scream to me "Hey, your class has too many dependencies, therefore, it does too much!"
However, given this class is strictly a factory, is that really the case? Should I be concerned about the growing number of dependencies? If so, what strategies should I consider for refactoring this?
Update:
I had considered the builder pattern, but for a factory, isn't that overkill?
(Ie., WidgetFactoryBuilder
, which builds a factory which builds widgets.).
Additionally, I don't understand how a builder really alleviates my dependencies - it just moves them from the constructor to methods -- which seems to obfuscate things more -- however this could be down to a poor understanding of how to apply the builder pattern in this situation.