I am currently trying to implement a marker interface in c#. But I haven't done this so far so I'd like to ask you for advice please.
Short my problem:
I've a interface Factory, and the factory contains several subinterface which should be marker interface because they don't have a property or method or something. So the marker interface should implement the interface factory. And my marker interface is for example for Cars, Trucks etc. And the marker interface is implemented for Cars for MyBMW, MyAUDI etc. How can I implement such a pattern? Thanks!
interface Factory
{
string[] process (string [] entry);
}
You should think about using Attributes instead of interface to mark classes.
then you can decide in your code how to handle specific instances as the attribute is set.