this example is weird, because you have a service object (the provider) which depends on a value object (the current logged user). This generally does not work (because your service may need to be created before the authentication runs for instance). It would be better to write an example which can be implemented for real.