Hi, I’m new on meteor, I came from the Java and it’s popular Spring Framework and Laravel, a PHP framework that it’s growing so fast. Those frameworks provide facilites to use dependency injection using a service container, so you can:
Create a controller
class UserController extends Controller
{
private service;
public function construct(MessageService service)
{
this.service = service;
}
//Send a message via email, SMS, Slack...whatever that's specify in
//Service Provider
}
And inject the MessageService instance via a Service Provider doing:
serviceProvider.bind('MessageService', function () {
return new MessageService(app.make('EMailStrategy'));
});
This gives tremendous facilities: reduced dependencies, increased testability …
I see also the way that angular-meteor (also angular 2) gives the ability to use dependency injection, but it’s too angularish (although I like angular 2). And other javascript frameworks like http://adonisjs.com/ are now having the Service Container…so I asked: Is there a service container in meteor?