in reply to Re: May Thy Closures Be Blessed
in thread May Thy Closures Be Blessed
Both are based on lexical scoping to enforce encapsulation.But an entire different kind of encapsulation! The closure based method as outline does data inheritance. By default, and you'll need to do work to prevent it. Inside Out objects don't do data inheritance (except if you define your subclass in the same lexical scope as your superclass - but you probably have good reasons to do so).
Furthermore, Inside Out objects don't require their superclass, or subclasses, to cooperate. With the Inside Out technique, you can subclass anything, including a closure, without interfering. Even if the superclass changes its implementation, you're safe. The closure based strategy only works if the entire inheritance tree uses the same closure.
Inside Objects are about maximizing freedom - it does not impose, and it does not require. ;-)
|Replies are listed 'Best First'.|
Re: Re: May Thy Closures Be Blessed
by hardburn (Abbot) on Apr 26, 2004 at 17:58 UTC
Re^2: May Thy Closures Be Blessed
by adrianh (Chancellor) on Apr 26, 2004 at 17:08 UTC