Small
Keeping objects small makes them easier to understand, less complex and easier to change in the future
Smells
Large number of constructor arguments
If the object is becoming difficult to construct due to the number of argument. Now is the time to break it down. Avoid creating builders or factories to try and hide this problem. look for groups of arguments that could become objects in their own right. A similar symptom can be a large number of getter methods.
Private static methods
Private static methods can be an indicator that your object needs to be broken down. A private methods that doesn’t need access the objects state, and has values passed to them as parameters to operate on can also be a sign that a new object should be created.
You may have something like…
|
|
That can be turned into ….
|
|