I realize this question is not completely cut and dry, but in general how do you know when an object has too many types?
I’m currently supporting a project in which I am unfamiliar with the baseline but am tasked to basically do bug fixes in a push to work down the number of items in our SPR database. I keep coming across classes that extend many different interfaces, including one such class which extends a total of twelve. Many others extend 7 or 8.
Now I know it’s good design practice to depend on interfaces rather than concrete implementations, but is this going too far? Is this an actual code smell and potentially a sign of bad design, or am I just overreacting and depending on circumstance, it can be normal for a class to extend seven, eight, and even twelve different interfaces? It is tiring grepping through the baseline trying to track down the actual concrete type(s) of an object that implements twelve interfaces.
To be able to prove that code smell you have to answer (correct answers in parethesis):
There are probably more questions to answer, feel free to add in comments.