I hope I understood your question correctly. Here's how I could do to create an extensible system for both common methods and sensor implementations:
( ):
, Reflection, , , ISensorMethod ( ). .
, execute() , , string Key { get; }.
, ( ).
- (, ) List<ISensorMethod> .
"":
: , "Sensor" "ISensor".
.
Sensor ( ), IMethodCaller, .
public interface IMethodCaller
{
void CallMethodByKey(string key);
}
:
public class ElectricSensor : Sensor
{
public ElectricSensor(IMethodCaller caller): base(caller)
{
}
public void CommunicationStart()
{
base.Caller.CallMethodByKey("START_COMMON");
base.Caller.CallMethodByKey("INITIALIZE_ELECTRIC");
}
}
Sensor factory...
.
Reflection , , , , ... ( , ).
,