Firt of all, sorry for my "EngRish". I'm revisiting some of my project to make them more usable/understandable by my co-workers; I'm developing a framework for integrate a protocol driver to our SCADA system, in a nutshell i have an abstract class that provide some common functionalities that must specialized by the protocol driver, for example:
Opening a comunication with the field:
Called Method:
void ConnectionOnScan(string connectionName)
In the base class i have something like this:
public void ConnectionOnScan(string connectionName)
{
//... some preliminary operation here
try
{
ConnectionOnScan(channelNumber);//provided by the derived class
}
catch (Exception e)
{
//some code here to properly register the fault to the SCADA System
}
}
The method that should be provided by the derived class should be (according to the system):
void ConnectionOnScan(UInt64 channelNumber)
Normally the driver must do something inside this method, in small cases this method can be empty.
My Goal is to let the develompent of a driver as simple as possible even for low-skilled programmers.
I have around 30 methods with the same use case: what will be best practice? declare them abstract or virtual (with an empty method)?