4 ms·
It always just feels like unnecessary terminology and technology. Here's the core pattern. function app(injected) { return injected.doSomething();
by tel 12y ago
It always just feels like unnecessary terminology and technology. Here's the core pattern.
function app(injected) {
return injected.doSomething();
}
function main() {
var injectable = new Injectable();
var result = app(injectable);
console.log(result);
}
Everything else is around obscuring that core pattern or making it "convenient" by providing some kind of naming abstraction. That at least makes a little bit of sense in Javascript, like above, since you need the stringy names to simulate types... but in any language with nominal typing you're just killing yourself with unnecessary complexity.