[OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

Andreas Hocevar ahocevar at opengeo.org
Sun Jul 24 16:43:13 EDT 2011


Hey Schuyler,

I'm not concerned about breaking backwards compatibility here. We never encouraged people to override the initialize method by re-assigning it on the prototype, and we always advertised the initialize method as constructor. With 2.11, finally, the initialize method is a real constructor, i.e.

X.prototype.initialize === X.

So instead of

X.prototype.initialize = function() { ... }

which we never encouraged people to do anyway, people could now do

X = X.prototype.initialize = function() { ... }

Andreas.

On Jul 24, 2011, at 22:07 , Schuyler Erle wrote:

> 
> On Jul 24, 2011, at 4:43 AM, RICHARD Didier wrote:
> 
>> With 2.10, overloading constructors was as simple as overwriting the
>> initialize prototype :
>> 
>> X.prototype.initialize= function () { ...}
>> 
>> In 2.11-RC1, it breaks as the new prototype is not the constructor !
>> ...
>> 
>> BTW, as this new OpenLayers.Class is a major change in OpenLayers, don't
>> you thing it is more a 3.0 feature than a 2.x ?
> 
> I confess I'm a little concerned about this... Are we breaking backwards compatibility with such a change?
> 
> SDE_______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Dev mailing list