A far more effective method for this I think is just to do protype inheritance the way javascript is designed.
other.prototype = Helper; no looping over accessors and trying to figure out if you already have this method or accessor in your object. I had never really thought of MochiKit as an OO helper library. The joose project is probably closer to what you are looking for in a class helper: http://code.google.com/p/joose-js/ MochiKit I think has different goals. Disclaimer: I am an occasional contributer to the joose project. On Mon, Oct 6, 2008 at 10:40 AM, Akari no ryu <[EMAIL PROTECTED]>wrote: > > Ok, I've searched through the archives for posts referencing the word > "inheritance" but most of them are just referring to prototype and the > lack of scope that JS gives you if you don't bindMethods(this) > I'm asking about actual OO inheritance in this post, wherein a class > inherits methods from another class. > > I've also tried google but that was utterly useless. Gave me > suggestions for code which doesn't work when you're using MochiKit, > because of the bindMethods function. > > I've added a bequeathTo method to my helper class which does the > following > > Helper.prototype.bequeathTo = function(other) > { > for(var i in this) > { > other[i] = MochiKit.base.bind(this[i], other) > } > } > > That works. > It's been tested and implemented in two classes that inheret methods > from it. > I'll upload my code for linkage later. > > I don't know if all y'all want to implement this but I though I'd post > just in case. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---
