I have several classes that conceptually belong to one tier. They have no common properties which is why they have no need to inherit from some base class.
I also have a few methods that deal with these classes. Some of them are templates of the following style:
public SomeClass
{
public void SomeMethod<T> (T argument) where T : BaseClass
{
/* Do something */
}
}
So I'm using this WHERE keyword just to secure the code (from myself I suppose), so that I don't by mistake feed to this method something else.
Naturally I made those other classes derive from BaseClass which is empty and has no other purpose (at least for now) than to group other classes.
This is probably not that good approach but anyway I'm using it.
Is there a better way to do this?
EDIT: After consideration I decided not to go with that approach and just removed that base class. Good enough without it. I cannot make the code absolutely perfect anyway, and the less unneeded thing there are the better.