I've written two successful open source IoC containers (HiveMind and T5 IoC). I don't really see the need for an IoC container for Clojure. It is interesting that coding a stateless IoC layer in OO is a step towards functional (T5 IoC does a lot of functional composition and supports lazy evaluation after a fashion). However, Clojure & Functional is "cut to the chase" relative to IoC in an OO environment and Clojure (via Vars and (binding) ) supports a lot of concepts that would be extremely difficult to do using an IoC container.
When doing Tapestry training I'm often faced with the question: "If Tapestry pages are stateful (and that's good) why is it also good that IoC services are stateless?" I think it's because a page (and its mutable state) is modeling a user (which is naturally stateful) while IoC services are modeling an operation which is very functional: inputs, outputs and (generally) no side effects (except for database updates). On Tue, Jun 16, 2009 at 7:13 AM, Stuart Halloway <stuart.hallo...@gmail.com>wrote: > > Hari, > > I agree--dependency injection is not about OOP. It is about working > around limitations in certain languages where it is difficult to > decouple components for testing and flexible deployment. > > I have not encountered similar limitations in Clojure. Do you have an > example in Clojure that makes you wish for DI? I would be interested > in taking a look and suggesting a more idiomatic Clojure approach. > > Cheers, > Stu > > > Hi, > > clojure web site says - "Clojure multimethods are a simple yet > > powerful mechanism for runtime polymorphism that is free of the > > trappings of OO, types and inheritance" . > > > > I think dependency Injection has nothing to do with just OOP, though > > it came out in OOP. > > Why not dependency inject arbitary code to another arbitary code?? > > > > Thanks & Regards, > > Hari Sujathan > > > > > > > > > > -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---