Dependency Injection

I’m not sure what your question is, but that isn’t DI. Using DI the class is not aware of the container.

In addition, having multiple serialisation methods in the same class like this is a bad idea. Funnily enough I used a very similar example here: https://r.je/single-responsibility-principle-how-to-apply

1 Like