jobbrIO / jobbr-server

Jobbr is a non-invasive .NET JobServer
https://jobbr.readthedocs.io
GNU General Public License v3.0
50 stars 5 forks source link

.NET 6 update #84

Closed RKivioja closed 1 year ago

RKivioja commented 1 year ago

@eXpl0it3r

I assume you've added all these interfaces for testability?

Yes. That is one reason, but it is also generally just a good idea to inject interfaces instead of class implementations. I didn't see any reason why these classes should be missing interfaces. SimpleInjector is also tremendously easier to use this way.

eXpl0it3r commented 1 year ago

IMHO interfaces should only be added if they actually serve a purpose. If a single class implements a single interface and we're never mocking the interface, then there's no added benefit, on the contrary, you've added additional code and slightly more complexity. Also YAGNI.

But I think it's okay here, was more of a general recommendation, not everything needs an interface. 😄