I have a situation which I think I need the functionality provided by an interface and an abstract class.
I am creating models to be used in a simulation. Each model is contained in a C# class that implements an IModel interface (of my design so it can be modified). I also created a c++ unmanaged Win32 DLL that acts as a bridge between my C# model classes and the simulation environment. The model classes are called via COM, hence the requirement for an interface.
I have just received a new requirement that these model classes should be callable via a web service independently of the simulation environment. Now these models are rather sensitive, and the client has requested that they be configured by the client and executed on the server*. I figured this would be possible if I made the model classes inherit from an abstract class, then created a web service method on the server:
public AbstractModel executeModel(AbstractModel modelForExecution)
that receives a model object from the client, executes it and populates it with results.
BUT - I cant use an abstract class because the models require an interface for the COM implementation.
How can I reconcile these two requirements? I've been told that it is possible to have a class implement an interface AND have that class derive from an abstract class, but I cant find any examples of that. If its possible, what is the syntax? If its not possible, what else should I do?
*the model classes actually call an ancient fortran executable, so the model configuration of the classes does not give away too much information about how the model works.