DEV Community

Discussion on: Build a Different Burger

Collapse
 
roddi profile image
Ruotger Deecke

I would always avoid stringly-typed interfaces. Neither the compiler nor any other tool can check the correctness of your calls.

I also think that both of you are overthinking things. Having a class that needs more than 5 things fed to its constructor is a big red flag and might be your real problem. I'm pretty sure you only use a few of all the possible combinations of objects.

If this is about dependency injection I always use a dependency structure that keeps all needed dependencies and can be passed as one parameter.