I have around 200 classes. 5% of them are unique, 95% of them have properties
int CantonID
int EntityID
int MunicipalityID
// other fields
and around 70% of these 95% have
int CantonID
int EntityID
int MunicipalityID
int Year
int Month
//other fields
(other 30% of these 95% don't have year and month properties).
So what is best solution to approach this? My idea was:
- these 5% of unique should be independent
- remaining 95% will inherit
BaseClass
that have fields:
int CantonID
int EntityID
int MunicipalityID
but I am not sure what to do with Year and Month. I can't add them to BaseClass
because 30% of them will inherit properties that they should not have, but I don't know how to encapsulate them. I was reading about builder design pattern, but I'm not 100% sure it is for this situation.