Hi people!
I'm working with a C# plugin architecture. Plugins are DLL's which expose a bunch of presenters, which are objects that implement the IPresenter interface. The IPresenter interface is available in a DLL shared by all plugins. Presenters can also implement additional methods as defined by IAction interfaces, like ILoadAction, ISaveAction etc. These interfaces are also shared by the same DLL so all plugins can have presenters that implement such interfaces.
Case: I have presenter X in plugin A which implements the IPresenter interface and the ILoadAction interface. In plugin B, I ask the plugin architecture to give me a presenter X. This gives me an IPresenter object. To call the LoadAction method of that presenter, I have to cast the presenter to ILoadAction.
Problem: if I remove ILoadAction from presenter X in plugin A, the code in plugin B will still compile even though the presenter doesn't implement ILoadAction anymore. In such cases, I'd like to be warned by the compiler. Actually, I'd like to avoid having to cast to a certain IAction all the time...
Question: how to deal with that?