Hi,

I'm reviewing in detail the new qooxdoo 0.7, and have a doubt.

For calling the overriden function here is the old syntax:

 qx.OO.defineClass("my.cool.Class", 
   my.great.SuperClass,
   ...
 });
 
 qx.Proto.foo = function(x) {
   my.great.SuperClass.prototype.foo.call(this, x);
 };

and the new one:

 qx.Class.define("my.cool.Class", {
   extend : my.great.SuperClass,
   ...
   members : {
     foo : function(x) {
       this.base(arguments, x);
     }
   }
 });

Clearly, the new form has more advantages.

But how would I convert this to the new syntax?:

 qx.OO.defineClass("my.cool.Class", 
   my.great.SuperClass,
   ...
 });
 
 qx.Proto.foo = function() {
   this.debug('a');
   my.great.SuperClass.prototype.foo.apply(this, arguments);
 };

I use often this construct, because if I change later the signature of a
method (adding more parameters), I don't have to update all overriden
methods, provided I'm calling the base method with unmodified parameters).

Regards,
David
-- 
View this message in context: 
http://www.nabble.com/New-method-overriding-tf3702549.html#a10354050
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to