AOP Compatibility

Brendan Eich brendan at mozilla.org
Wed Feb 20 17:32:54 PST 2008


On Feb 20, 2008, at 4:21 PM, Kris Zyp wrote:
> Of course a library function (like dojo.connect) that is called to  
> advise a
> method on an object doesn't have control of how the object was  
> created. If
> it is an instance of user class (and not dynamic), this function  
> will this
> fail. This functionality is pretty core and heavily used by Dojo and I
> believe is used by other libraries as well. Of course existing code  
> will
> continue to work, but it will be disappointing to find this  
> function fail
> for new objects created with ES4 functionality. I don't know an easier
> solution, other than real AOP support.

I think you're assuming a problem of the "Doctor, it hurts when I do  
this" variety. Non-dynamic classes are not for everything. Where you  
need them as integrity devices, you do not want Dojo's AOP, no way no  
how. Most objects will continue to be plain old Object instances. But  
note that even in today's world, DOM types are nominal -- there are  
non-dynamic classes under the hood. Not all DOM or similar browser  
embedding objects can be mutated freely. Dojo survives these hazards,  
as far as I know.

/be




More information about the Es4-discuss mailing list