Javascript Di/ioc Equivalents To Standard Di Patterns For Statically Typed Languages
.NET and Java both have a slew of DI/IoC containers available to them and each have a number of patterns that I've found very useful at various points in working with them. I'm now
Solution 1:
Some of the functionality you mentioned is achieved by using AMD. For example look at RequireJS: http://requirejs.org/docs/whyamd.html
Another implementation worth looking at is of Angular JS DI: https://docs.angularjs.org/guide/di
You can easily inject modules (units of functionality wrapped in a closure and metadata) in such a way that implementation is abstracted away. It allows to switch implementation, run mocks in test units and much more.
Hope it helps
Post a Comment for "Javascript Di/ioc Equivalents To Standard Di Patterns For Statically Typed Languages"