From: Christian Neukirchen Date: 2005-09-27T04:26:51+09:00 Subject: Re: [ANN] My dependency-injection library Nikolai Weibull writes: > Christian Neukirchen wrote: > >> I really fail to see the advantage of using this over manual require >> and dependency setting. :-) > > Well, the thing is, what do you do when you have a compiler class > > class Compiler > ⋮ > raise Error, … raise Injections::Error > ⋮ > end Injections::Error = ScriptError > > that also ‘needs’ our error class? Stuffing everything into Injections makes it all use the same namespace, as with yours. >> I personally would expect a DI framework to at least provide a >> singleton instantiation scheme, else it wouldn't make any sense to me >> at all. > > Well, maybe so, but the idea of my library is that all you really need > is to be able to bind constants to classes. It’s definitely not much, > but I found that that was precisely what I was looking for. That's fine, go ahead with it. I like people solving *their* problems in *their* way. I'm one of them too. :-) >> I think anything more simple than Matz-DI is too simple. >> > http://onestepback.org/articles/depinj/matz/index.html > > Perhaps, but again, all I was looking for is done by my library. I’m > certainly not trying to force people to stop using needle or some other > library (e.g., dissident). To me, needle is doing a bit too much and I > seem to have a hard time reading your examples for dissident (how do you > do namespacing in dissident?), so I haven’t given it a chance yet, You declare the classes to belong to a given "library". You can setup different containers for each library. > nikolai -- Christian Neukirchen http://chneukirchen.org