[OpenLayers-Dev] Re: [OpenLayers 3] type instantiation performance

Xavier Mamano (jorix) xavier.mamano at gmail.com
Fri Oct 22 10:03:40 EDT 2010



Andreas Hocevar-2 wrote:
> 
> Now why wait for 3.0? This can easily be wrapped into OpenLayers.Class
> (and that's what I was hoping for when I meant "OpenLayers.Class has room
> for improvement"). I have just created
> http://trac.osgeo.org/openlayers/ticket/2899.
> 
> ...
> -- 
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> 
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
> 
> 
Hi, 

There is also the reverse possibility: compatibility super class pure
javascript with the inherit by OpenLayers.Class.

It is only necessary:

A = function () {} / / constructor
A.prototype = {
    ...
    initialize: function () {
        A.apply(this, arguments);
    }
}, / / Prototype definition

Some days ago has started to test this on popups, to see time with larger
objects and inheritance and cross inheritance. Works, but I have not
finished the test of time.

NOTE: Another advantage of pure Javascript is the time of initiation, but
this is even more difficult to measure.

Regards,

Xavier

-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OpenLayers-3-type-instantiation-performance-tp5641805p5662662.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.


More information about the Dev mailing list