If I'm trying to follow SOLID principles and I have a hierarchy like this
Punishment > PardonablePunishment > TemporaryPunishment
Should I do this with abstract classes or interfaces?
I have a lot of fields to create like this:
UUID target;
Issuer issuer;
Reason reason;
Duration duration;
...
And the last field I have is a Punishment Type which is an enum. The only reason I have this enum is because im saving data with GSON. Each enum looks like this:
Type.BAN(Ban.class)
Type.MUTE(Mute.class)
I need this so when I deserialize json, I'm able to link back which Punishment is which class.
And I feel like there's a lot better of a way to do this but I'm unsure.