omniaretail / nimator

Light-weight adhoc framework for creating monitoring apps with c-sharp based system-checks.
MIT License
10 stars 9 forks source link

Remove Level and CheckName setters from ICheckResult and CheckResult #12

Closed jeroenheijmans closed 8 years ago

jeroenheijmans commented 8 years ago

Both ICheckResult and (obiviously) CheckResult have setters for these properties:

public NotificationLevel Level { get; set; }

and

public string CheckName { get; set; }

We found while dogfooding that it often makes sense to have an implementation of ICheckResult that does not have such a setter for e.g. the Level, because it's a read-only / derived property. There was no sensible or useful implementation for the setter.

In addition, currently these setters aren't used anywhere in Nimator itself either.

So, we might as well get rid of these setters.

jeroenheijmans commented 8 years ago

Actually, it makes sense to leave it on the concrete CheckResult class, making it easier for others to use the class (e.g. create an instance first, and assign the actual level later). But as for the interface: it's really not needed, and if it's removed implementations with read-only versions of those properties will also be possible.