I cannot seem to google this one correctly... I have a class (Widget) that represents a database table from the Data Layer.
The table holds 3 different types of records, where one uses only 5 columns, another uses 10 columns etc. Each record has a different set of validation and business rules that I want to control with Business Layer abstraction.
Is the proper thing to create 3 concrete classes and map the properties to the single database table class? I feel like I'm missing an opportunity to use an interface or inheritance?
If I want something like below wouldn't my Widget classes inherit from the database table class that holds all widgets? And if it did, then how would I "hide" or disinherit the properties betwen the specific widget types?
List<SmallWidget> sw = BusinessLayer.GetWidgets<SmallWidget>();
List<MediumWidget> mw = BusinessLayer.GetWidgets<MediumWidget>();
List<LargeWidget> lw = BusinessLayer.GetWidgets<LargeWidget>();
Thanks for the advice.