DEV Community

Discussion on: An IoC pattern to avoid repetitive if statements

Collapse
 
tomazfernandes profile image
Tomaz Lemos

Hi Bertil,

Thanks for your feedback! The String input and return types where wrong leftovers from a earlier version, I have fixed it, and also put the comment where the Assert class is missing.

By saying the code doesn’t compile, you mean you think I should provide implementation to all classes, such as the handlers, IncomingData and ProcessingData? Perhaps that would introduce too much not important code? Or at least I should make clear I’m not providing those classes.

The constructor idea is indeed better, I’ll change it as soon as I get to my computer. In my original post I used Spring for DI and received a List in the constructor, but a fellow DEV correctly suggested I should make the examples framework agnostic, and I missed this improvement.

Thanks a lot for your feedback!

Collapse
 
bertilmuth profile image
Bertil Muth

Hi Tomaz.

By saying the code doesn’t compile, I really just meant the types and the missing Assert class (as described in my comment).

For me, the incompleteness is less of a problem.

Thanks for reacting so quickly, and happy new year :-) !

Thread Thread
 
tomazfernandes profile image
Tomaz Lemos

Thanks a lot Bertil, and happy new year to you too!