Timeline for Dependency Injection in Chain of Command pattern
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 15, 2018 at 12:31 | history | edited | Doc Brown | CC BY-SA 4.0 |
deleted 11 characters in body
|
May 14, 2018 at 8:40 | comment | added | Doc Brown | @george007: using separate factory classes gives another advantage: the command handler classes can be grouped into a module on its own, where the module is completely independent from the services. The services reside in a different module, independent from the command handlers, and the factories in a 3rd module which depends on the others and binds them together. So in a well modularized system, "one class to rule them all" makes no sense, having separate classes for this is a standard approach and should not cause any superstitious fears about getting "too many classes". | |
May 14, 2018 at 7:44 | vote | accept | george007 | ||
May 14, 2018 at 7:44 | comment | added | george007 | Thank you @Doc Brown. So it seems that it is either "one class to rule them all", but this class would need something like a Reflection to identify what each module needs, or a Factory class for each module, where I can manually define injected services. I haven't thought about this approach. It seems that it may the best one (although it hurts me when I think that it needs twice as much classes, and it can't be easily simplified ;) ). | |
May 12, 2018 at 7:21 | history | edited | Doc Brown | CC BY-SA 4.0 |
added 227 characters in body
|
May 11, 2018 at 12:10 | history | edited | Doc Brown | CC BY-SA 4.0 |
added 109 characters in body
|
May 11, 2018 at 11:56 | history | edited | Doc Brown | CC BY-SA 4.0 |
added 244 characters in body
|
May 11, 2018 at 11:50 | history | answered | Doc Brown | CC BY-SA 4.0 |