Skip to main content
14 events
when toggle format what by license comment
Jun 17, 2023 at 16:59 comment added Doc Brown @J.Mini: I don't have that book, but I guess Seemann does not write "never use Func" (as well as I did not tell you always use Func as a replacement for interfaces).
Jun 17, 2023 at 16:38 comment added J. Mini Interestingly, page 272 of that same book advises against depending on Funcs. Either its reasoning is unconvincing or it went over my head.
Jun 12, 2023 at 15:37 history edited Doc Brown CC BY-SA 4.0
added 311 characters in body
Jun 12, 2023 at 8:39 comment added Doc Brown @J.Mini: well, at least I told you to look at the idea of a facade service to reduce the number of constructor parameters of your Form1. "constructor over-injection" sounds like a good name for this phenomen, but it is probably not so popular that it I think it is "surprising that nobody mentioned [it]".
Jun 12, 2023 at 8:04 comment added J. Mini Coincidentally, I've just reached the part in Mark Seesman's Dependency Injection Principles, Practices, And Patterns that mentions Facade Services. It's quite surprising that nobody mentioned the overarching topic of that chapter, namely that "constructor over-injection" is not an anti-pattern but is a code smell.
Jun 11, 2023 at 15:32 comment added Doc Brown ... another approach to reduce the number of factories in this case could be to make use of the Prototype pattern, see my edit.
Jun 11, 2023 at 15:26 history edited Doc Brown CC BY-SA 4.0
added 43 characters in body
Jun 11, 2023 at 15:18 comment added Doc Brown @J.Mini: the sheer number of factories will not tell you if the design is good or bad. If you are going to write individual unit tests for which all these different factories are required, then you probably need them all. But maybe when introducing a facade service, it could turn out you will only need a single factory for that service itself, so you can mock it out with one mock factory for all your tests. This is case dependend and can only be answered sensibly by looking at the real code.
Jun 11, 2023 at 13:00 vote accept J. Mini
Jun 11, 2023 at 13:00 comment added J. Mini This is absolutely excellent and shows many ways to simply my design. It has just one omission: Is my composition root needing many of these factories a sign of bad design?
Jun 11, 2023 at 11:24 history edited Doc Brown CC BY-SA 4.0
added 262 characters in body
Jun 11, 2023 at 11:19 history edited Doc Brown CC BY-SA 4.0
added 262 characters in body
Jun 11, 2023 at 11:10 history edited Doc Brown CC BY-SA 4.0
added 262 characters in body
Jun 11, 2023 at 10:55 history answered Doc Brown CC BY-SA 4.0