From: Jamis Buck Date: 2004-11-15T10:56:20+09:00 Subject: Re: [ANN] MinDI: Minimalist Dependency Injection Joel VanderWerf wrote: > > MinDI is a DI (dependency injection) or IoC (invesion of control) > framework for ruby inspired by Jamis Buck's Needle > (http://needle.rubyforge.org) > and Jim Weirich's article on DI in Ruby > (http://onestepback.org/index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc). > Nice work, Joel! It's nice to have a little competition. Drives the quality up, I hear. :) Our recent discussion regarding multitons and parameterized services got me looking harder at Needle's internals, and I discovered that it is almost ridiculously easy to add them. So, Needle (in CVS) supports parameterized services and a multiton service model, working just like you would expect: registry.define.printer( :model => :multiton ) do |c,p,name| Printer.new( name ) end p1 = registry.printer( :monochrome ) p2 = registry.printer( :monochrome ) assert_same p1, p2 p3 = registry.printer( :color ) assert_not_same p1, p3 I'll be pushing this change out on Thursday as version 1.2, in keeping with Needle's weekly release schedule. Thanks to Joel and Christian (Neukirchen) for the impetus to add the feature. :) - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis