Timeline for How to use dependency injection and avoid temporal coupling?
Current License: CC BY-SA 4.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 3, 2019 at 6:15 | history | undeleted | Engineert | ||
| May 3, 2019 at 6:15 | history | deleted | Engineert | via Vote | |
| May 2, 2019 at 13:14 | history | edited | Engineert | CC BY-SA 4.0 |
added 769 characters in body
|
| May 2, 2019 at 12:57 | history | edited | Engineert | CC BY-SA 4.0 |
Removed static constructor.
|
| May 2, 2019 at 12:57 | comment | added | Engineert | @Ewan You are right. I will try to find a solution for it. But before that, I will remove it for now. | |
| May 2, 2019 at 12:54 | comment | added | Dusan | I am leaning towards injecting factory that can create and initialize the service with the given context data (rather than injecting service itself), but I am not sure if there are better solutions. | |
| May 2, 2019 at 12:49 | comment | added | Ewan | hmm wont that static constructor run before you set the context? and initialize in the constructor risks exceptions | |
| May 2, 2019 at 12:48 | comment | added | Dusan | OK, great, but... each instance of the client needs to have it's own instance of the service initialized with different context data. That context data is not static or known beforehand so it cannot be injected by DI in the constructor. Then, how do I get/create instance of the service together with other dependencies in my clients? | |
| May 2, 2019 at 12:40 | history | answered | Engineert | CC BY-SA 4.0 |