On 7/11/05, Mike Williams <[EMAIL PROTECTED]> wrote: > > > Darrell DeBoer wrote: > > > > > I think you're right - this mechanism is a bit clearer for cases > > > where we don't need subclasses to override behaviour. I'm not so > > > sure how we'd do it for locators where we have different > > > implementations for different BrowserBot subclasses - thoughts? > > > > A very good point. Hmmm, I'll have to think about it. > > Having thought about it a bit: what about delegation? Where there is > behaviour that may need to be overridden, the (anonymous) locator > function could just delegate to a named function on the prototype object. >
I'm not sure what you mean. The mechanism you suggested is kind of like static methods in java - I can't see how you can have 2 instances with different subclasses and slightly different behaviour. The problem is that there is only one static instance of, say, "BrowserBot.elementLocators". So you have to code up something in a subclass that first searched in "KonquerorBrowserBot.elementLocators" and then searched up the prototype hierarchy. Seems like you're losing the power of OO in JavaScript. Of course, the BrowserBot example isn't perfect, since you'll never need a Safari and Konqueror browserbot instance at the same time. But I'm sure there are other examples where this makes sense. Maybe I'm missing something, though? ciao Daz _______________________________________________ Selenium-devel mailing list Selenium-devel@lists.public.thoughtworks.org http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel