15

I have an interface implemented by 11 classes, coz u kno, it's "SOLID". But today i felt my life is a lie when a developer refactored my code and deleted all those classes and placed them in a Utils class with static methods, and slapped me with "Let's make it simple".

Comments
  • 1
    What, how, why... would someone do that
  • 6
    This sounds like someone very “experienced” in the field. Interfaces are there for a reason. Didn’t know utils oriented programming is a thing nowadays.
  • 1
  • 1
    Anyway it's my last day in the project. He can do whatever he wants. 🤣
  • 9
    @immutable just put everything in the main method, why are you people so difficult with all those classes smh
  • 2
    @alexbrooklyn alright, I'll add it in the backlog 🤣
  • 0
    Yeah forget about generics as well.
  • 0
    Is multiple instances using that code?
    Because if it is, that might lead to a lot of errors.

    I think it depends on what your library and implementations does, also, there are some other patterns that can be applied in here, like STRATEGY pattern
  • 2
    So you KISS'ed your code
  • 0
    I'd rather have too many classes than too few! I have a colleague that throws all the logic into the events... On the upside you know where to find everything, but on the downside it's all right there, jumbled together...
    Even if 11 classes were too much (not saying they are!) Proper interface implementation leaves a lot of options open down the road :-)
  • 1
    @ArcaneEye but don't forget 'bout YAGNI?-)
  • 1
    I decided to abstract it through an interface because those business logic for each class are frequently changing.
    The thing is, that guy is so afraid of interfaces to the point that you won't find any interface in the whole repo, other than the standard Service/Repository interfaces.
  • 0
    @immutable so instead of changing class or even using dependency injection, you're now stuck with rewriting the method every time? Seems fucking stupid tbh...
  • 0
    @phorkyas if business logic is changing regularly, you DO need that interface structure though.
Add Comment