I had a long class which I couldn't split up because I need all the fields in one database table (Google AppEngine + Objectify). I'm already using embedded classes wherever possible. The class consists mostly of getters and setters plus the logic behind them.
In order to get functional chunks I decided to use repeated inheritance. Now it looks like this:
MyStoredModel extends
AbstractSettingsModel extends
AbstractHierarchyModel
(dealing with parent/child objects)extends
AbstractInformationModel
(holds title, description, ...)extends
- .....
AbstractModel
It's easier to see what every class is doing and I'd also say it's easier to test. The downside is the "inheritance chain".
Is that considered bad behavior? What are be better ways to make the class smaller?