Is the code below fine? I'm asking myself if the Start()
and Stop()
method in the interface ICustomTimer
is fine as location. Because I need it in my Main method.
Is this a code smell or, in other words, what is the best practice to call a base method which has no abstraction? Timer
class has no interface that I can use to inherit from.
public interface ICustomTimer
{
string Value { get; set; }
//Implementation in Timer
void Start();
//Implementation in Timer
void Stop();
}
public class CustomTimer : System.Timers.Timer, ICustomTimer
{
public string Value { get; set; }
}
public Main()
{
var customTimerObj = iocContainer.Get<ICustomTimer>();
customTimerObj.Start();
}