From: Daniel Schierbeck Date: 2005-10-25T16:07:01+09:00 Subject: Re: Cut-based AOP Trans wrote: > Christian Neukirchen wrote: > >>"Trans" writes: >> >> >>>itsme213@hotmail.com wrote: >>> >>>>Does this also provide a quite general form of dependency injection, >>>>very different in nature and weight compared to something like Needle? >>> >>>Had to give this some thought. Mu immediate conjecture is that it must >>>since DI and AOP are closely related. But I'm no DI expert like Jim >>>Weirich. But in giving it some conosideration, I imagine there's not >>>much more to it than: >>> >>> class App >>> >>> def logger >>> nil # no logger available >>> end >>> >>> end >>> >>> cut AppContainer < App >>> >>> def logger >>> Logger.new >>> end >>> >>> end >> >>Which will make you want "multiple-inheritance" for cutpoints. :-) > > > I thought about this some but I don't understand what you mean. How ill > it make you want MI? Aren't mixins enough? > > >>It's not that trivial, but it certainly can be used to implement DI. > > > I realize that it's a trivialized rendition, but could you provided > some pointers on improving? > > Thanks, > T. > I can't see why there *shouldn't* be multi-inheritance for cuts, unless you need to be able to find the exact class that's being cut by a certain cut. cut Kut < A, B, C def initialize(*args, &block) puts "ahoy, mateys! arrr!" super end end Cheers, Daniel