ctrl
ctrl copied to clipboard
Rename serviceLocator to services
serviceLocator is a bit verbose.
I think it'd be sensible to introduce the convention of calling it services (convention, rather than renaming the module, because it's up to the functions that accept it to give it a name) eg:
function createRoutes(services) {
services.router.get('/', function (req, res) {
services.logger.log('Serving /')
})
}
Thoughts?
I think it is important that people understand that it is the service locator pattern. Some dependency injectors get passed around as 'dl', my only concern with that is that people will start turning everything into acronym which is really bad.
I has debate renaming this myself many times, but I've never quite managed to convince myself. I want to have an architectural debate soon, so let's leave it until then to make a decision.