On 20/09/2007, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > On 9/20/07, Les Szklanny <[EMAIL PROTECTED]> wrote: > > > > But, shouldn't have to do this or use $super(name). The superclass > constructor should be called automatically (as in Dojo for example). > > We have modeled OOP support in Prototype based on the most traditional > inheritance model. Most of the users don't expect overridden constructors to > be called automatically. If you want to call the superclass constructor, you > must use $super (please don't do Foo.prototype.bar.apply anymore) - that > also works with any other method in your classes. > > So, thanks for the suggestion, but we're keeping constructors this way.
If you've gone to the trouble of overriding a base/super class's method (constructor or member function or method or whatever), then it is your responsibility to call the overridden method if it is required. Nothing can guess that. Delphi uses inherited; PHP uses parent::xxxx() Prototype uses $super() Different words, same meaning (more or less). Excellent work all. Richard -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to firstname.lastname@example.org To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---