Also use DI, in my case it does:

- Autoloading and reloading code (kinda like Ruby on Rails).

    app.requireDirectory "#{__dirname}/controllers", watch: true, onDemand: 
true
    
The actual code 
https://github.com/sinizinairina/mono-example/blob/master/app.coffee#L21

- Assembling application and lazy loading things like DB to speedup server 
start time.

- Injection - automatically injects all needed objects in places where they 
needed. No need to 
pass `(req, res)` everywhere anymore. Just use `this.req` it also 
automatically creates and manages 
related things like `this.user`:

    function(){
      this.post = new app.Post(this.params)
      ...
    }
    
instead of:
    
    function(req, res){
      this.post = new app.Post(req.params)
      ...
    }
    
The actual code 
https://github.com/sinizinairina/mono-example/blob/master/controllers/Posts.coffee#L21

- Hook up before/after handlers - for example to do something before or 
after DB is loaded.

It's used in Ruby on Rails clone for Node.JS for example - definitions of 
different internal components
of that framework 
https://github.com/sinizinairina/mono/blob/master/mono.coffee

And, this is the only place when you have to tell DI what to do, after that 
all those components 
will be created and wired automatically and you don't have to see DI 
specific code in your application anymore. 

The best thing - no DI specific code in the application - You have the milk 
and don't have to care for the Cow :).

The IoC itself https://github.com/alexeypetrushin/miconjs

On Monday, 20 January 2014 19:54:27 UTC+4, Christoph Rust wrote:
>
> I know there are already quite a few DI frameworks available for NodeJS.
> Inject and dependable both offer a nice feature set...
> However I tried to combine the (from my perspective) most desirable 
> features into one framework - dips <https://github.com/devcrust/node-dips>
> .
>
> I'm curious about your feedback and suggestions on features you would like 
> to find in a DI framework.
>
> Github: https://github.com/devcrust/node-dips
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to