MVP and Dependency Injection
-
08-10-2022 - |
سؤال
I am working on WebForms and i am implementing the MVP pattern. My Presenter is dependent on 5 other classes to perform the actions on my form.
I am using dependency injection to make my code testable. However, my problem is since my presenter is dependent on too many classes I've to inject the dependencies of all these dependent classes in the presenter's constructor. This is a 'Too Many Parameters' code smell.
Guidance needed on how to go about solving this problem.
Help is appreciated.
Regards, Suyog
لا يوجد حل صحيح
لا تنتمي إلى StackOverflow