| The Samster wrote: |
|
Is it better to have a fewer number of methods in a certain class? In other words, if I have a class that keeps growing should I consider splitting it into several?
| |
Simple answer: no, don't split a class just because it has too many methods.
Real answer; you should be designing classes that are cohesive and decoupled. By just adding methods to a class over time it sounds like there is no design. Doing something like that means your class will not be cohesive and if you split a class up just to avoid many methods you've got highly coupled classes. You'll have a hard time maintaining classes like that.