ctrl icon indicating copy to clipboard operation
ctrl copied to clipboard

Rename serviceLocator to services

Open bengourley opened this issue 13 years ago • 1 comments

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?

bengourley avatar Nov 14 '12 12:11 bengourley

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.

serby avatar Nov 16 '12 10:11 serby