I'm trying to build a generic C# program of which the only purpose is to look at many classes that implement an IMonitoring interface, and execute the different steps each class implements.
The purpose of the monitoring is to check for the response time of different APIs, but trying to build it to be extensible to other type of services.
I'm trying to decide between having specific steps on the interface (like Initialize(), Execute(), LogResults()), or if the interface should have just one "Execute" method and then each implementing class can decide what steps it wants to follow.
The issue with implementing multiple steps on the interface is that I'd be limiting to those steps, even if I added some "hook" methods, but I don't think I can anticipate how many hooks and where to add them.
On the other side, if I have a single method, I fear that the implementing classes will not be very consistent.
Trying to keep this open-closed and extensible, but I'm not sure what the best solution would be.
Aucun commentaire:
Enregistrer un commentaire