I\'m new to this IoC and DI business- I feel like I get the concept if you are passing along objects that are of a global scope, but I don\'t get how it works when you need to p
When you construct an service object (e.g. WriteFileService
), you inject into it things it needs internally to complete it's job. Perhaps it needs a filesystem object or something.
The Person
object in your example should be passed to the service object as a parameter to a method call. e.g. writeFileService.write(person)