I have the following object model:
class CheckoutAd{
int AdId;
int ImpressionCap;
int ClickCap;
int ConversionCap;
// ...
}
class SiteAd{
int AdId;
int ImpressionCap;
int ClickCap;
//...
}
As you see there is duplicate code. So i decided to put the duplicate code in a base class and extend the above classes from base class as follows:
class BaseAd{
int AdId;
int ImpressionCap;
int ClickCap;
}
But then I thought about the future which there will be a MobileAd class that this base class might not be a good candidate then I would have to change it.
Should I delegate these properties instead?
How would you do it?
Should i use strategy pattern ? how would i delegate this behavior?