# Needle + Rails - IoC

**URL:** <https://www.ruby-forum.com/t/needle-rails-ioc/59867>\
**Category:** Rails\
**Created:** [May 7, 2006, 11:25pm UTC](https://www.ruby-forum.com/t/needle-rails-ioc/59867 "2006-05-07T23:25:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [May 7, 2006, 11:25pm UTC](https://www.ruby-forum.com/t/needle-rails-ioc/59867/1 "2006-05-07T23:25:26Z")

</div>

Hi,

I’m looking for past efforts to integrate Rails and Needle. I am  
thinking of doing it myself but would be interested in seeing what  
others have done before.

If there are examples of other IoC frameworks being used with Ruby I’d  
be interested in hearing about them too. I find IoC to be a helpful  
concept in general and, having glanced at a few existing Rails app.s, I  
think it’d be useful in conjunction with Rails.

My main goal, right now, is to wire the controllers at request time, so  
that they be injected with services from the Needle registry. Being new  
to Rails I have the background thought that I could do this with a  
plugin? I think that I probably need to wire up the controller during  
the execution of the recognize method in the RouteSet class.

All thoughts welcome, especially past experiences about the same effort.

Cheers,  
Nick

---

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [May 7, 2006, 11:37pm UTC](https://www.ruby-forum.com/t/needle-rails-ioc/59867/2 "2006-05-07T23:37:48Z")

</div>

On 07/05/06, Nick F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m looking for past efforts to integrate Rails and Needle. I am  
> thinking of doing it myself but would be interested in seeing what  
> others have done before.
> 
> If there are examples of other IoC frameworks being used with Ruby I’d  
> be interested in hearing about them too. I find IoC to be a helpful  
> concept in general and, having glanced at a few existing Rails app.s, I  
> think it’d be useful in conjunction with Rails.

I know it was considered about a year or so back. See:

[http://ruby.jamisbuck.org/rails-injected.html](http://ruby.jamisbuck.org/rails-injected.html)  
[http://www.loudthinking.com/arc/000357.html](http://www.loudthinking.com/arc/000357.html)

but I got the impression Jamis and DHH went off the whole IoC buzz

- but they’re big boys, they can speak for themselves 🙂

–  
Rasputin :: Jack of All Trades - Master of Nuns  
[http://number9.hellooperator.net/](http://number9.hellooperator.net/)

---

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [May 8, 2006, 4:38am UTC](https://www.ruby-forum.com/t/needle-rails-ioc/59867/3 "2006-05-08T04:38:13Z")

</div>

Hi Dick,

Thanks for your reply.

Yes, I found those links when I googled for Rail and Needle. I really  
thought someone would have been using Rails plus some sort of IoC  
solution by now, so I wanted to ask for something more recent. I should  
have said that I had found those pages in the original email.

Well, it looks like I’m on my own then. I’ll see how far I get with  
hooking Needle up to Rails!

Cheers,  
Nick

---

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [May 8, 2006, 12:33pm UTC](https://www.ruby-forum.com/t/needle-rails-ioc/59867/4 "2006-05-08T12:33:52Z")

</div>

If I remember correctly DHH integrated dependency injection features  
into the Rails framework over a year ago (might be a bit more than a  
year ago).

Cheers

## Jonathan

> **[AgileEvolved.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=agileevolved.com)**
>
> Own this domain today. We make your shopping experience easy. Friendly and quick customer service.
