Aha! You know, I've learned my lesson on that score: never build something
without a use case. Sometimes it's fun (see Fx.Sort on Clientside) but then
you have this code and no use for it.

On Fri, Oct 10, 2008 at 9:18 AM, Nathan White <
[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> wrote:

> I completely agree. I got wrapped up into theory and what ifs while digging
> into the framework.
>
> I actually spent a good part of last night trying to think of a good
> example case. I was unable to locate a single scenario that was more
> appropriately solved by a different design pattern.
>
> Nathan
>
> On Fri, Oct 10, 2008 at 11:54 AM, nutron <[EMAIL 
> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1316804&i=0>
> > wrote:
>
>>
>>
>> I agree. If you have an inheritance scheme that needs to skip a generation
>> to
>> get back to the original class, your design needs to change. This kind of
>> thing only makes code harder to understand. I suggest you break your logic
>> out into more methods so that you can call them without this kind of
>> pattern.
>>
>>
>> ibolmo wrote:
>> >
>> >
>> > Why would you want the base?
>> >
>> > Olmo
>> >
>> > On Oct 9, 8:49 am, "Nathan White" <[EMAIL 
>> > PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1316804&i=1>>
>> wrote:
>> >> The reworking of class looks great.
>> >>
>> >> I realize that its best to use shallow inheritance in javascript for a
>> >> number of reason but on several occasions I have created a classes that
>> >> are
>> >> extended 2-3 levels deep. I understand that this is not a common
>> scenario
>> >> but in these situations I have had the need to refer to the 'base'
>> method
>> >> and not the 'parent'.
>> >>
>> >> What do you think of the following code replacing line
>> >> 86-88<
>> http://github.com/mootools/mootools-core/tree/master/Source/Class/Cla...>
>> >> .
>> >>
>> >>     if (caller){
>> >>         object.parent = function(){
>> >>           return arguments.callee.caller.__parent.apply(this,
>> arguments);
>> >>         };
>> >>
>> >>         object.base = function(){
>> >>             var p = arguments.callee.caller;
>> >>             while($type(p.__parent) == 'function') p = p.__parent;
>> >>             return p.apply(this, arguments);
>> >>         };
>> >>     }
>> >
>> >
>>
>>
>> -----
>> The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com
>> CNET Clientside:  http://clientside.cnet.com clientside.cnet.com
>> --
>> View this message in context:
>> http://n2.nabble.com/re%3A-class-inherit-suggestion-tp1312639p1316732.html
>> Sent from the MooTools Users mailing list archive at Nabble.com.
>>
>>
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/re%3A-class-inherit-suggestion-tp1312639p1316804.html
> To start a new topic under MooTools Users, email
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
CNET Clientside:  http://clientside.cnet.com clientside.cnet.com 
-- 
View this message in context: 
http://n2.nabble.com/re%3A-class-inherit-suggestion-tp1312639p1316806.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to