On Sunday, October 17, 2010, Peter Robins <openlay...@peterrobins.co.uk> wrote: > On 17 October 2010 12:24, Eric Lemoine <eric.lemo...@camptocamp.com> wrote: >> To illustrate again how things would look like with what I'm >> proposing, here's an example involving OL.Layer and OL.Layer.Vector, >> assuming the latter inherits from the former: >> >> OL.Layer = function(options) { >> // constructor >> ... >> }; >> OL.Layer.prototype = { >> // prototype >> ... >> } >> OL.Layer.Vector = function(options) { >> OL.Layer.call(this, options); >> ... >> }; >> OL.inherit(OL.Layer.Vector, OL.Vector, { >> // prototype >> ... >> }); > > um, shouldn't that read: > OL.inherit(OL.Layer.Vector, OL.Layer, {
Yes, sorry about that. > > ok, so the first 2 statements would be in the OL.Layer file, and the > 2nd 2 in OL.Layer.Vector > >> I don't think this is such a major change. It would basically just >> involve changing a few lines in all the files including class >> definitions. But maybe you see this as a major change for other >> aspects? > > no, actually, thinking about it some more, I don't think it would be a > major change, as the user/programmer would continue to write: > > myLayer = new OL.Layer.Vector(); Yes, no API change for instantiation. > > and wouldn't need to bother how inheritance is handled internally > >> As Andreas said, we could also address the overhead issue by using >> object litterals > > yes, agreed. Projection is another example. Though object litterals for projection objects doesn't sound like a good match to me. Cheers, -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : eric.lemo...@camptocamp.com http://www.camptocamp.com _______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev