ecowden / pluto.js

JavaScript Dependency Injection
MIT License
8 stars 3 forks source link

Angular-ize the API? #10

Closed ecowden closed 7 years ago

ecowden commented 10 years ago

I'm really not sure if this is a good idea or a terrible idea...

We've gotten very used to Angular-style dependency injection. Since Angular has gotten so much traction, it seems to make sense to adopt a similar API.

I could pretty easily adjust the API to look like:

pluto.module('myModule')
    .factory('myFactoryFunction', function(dependencyOne, dependencyTwo) {
        ...
    });

...but then there's artifacts (like a name for the module, or module dependencies) which don't seem to make sense for Node. There's no "multiple modules got loaded by the browser" thing - it's all just require(...) calls.

Guice-style bootstrapping seems to make more sense.

ecowden commented 7 years ago

Nope, dumb idea. Not doing it. 👎