Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do we need this.map = this.maps[this.api] everywhere? #290

Open
gilesc50 opened this issue Sep 29, 2013 · 2 comments
Open

do we need this.map = this.maps[this.api] everywhere? #290

gilesc50 opened this issue Sep 29, 2013 · 2 comments

Comments

@gilesc50
Copy link
Member

Could we set this.map = this.maps[this.api] for every provider in core, or does it need to be the first line of every init?

@dezfowler
Copy link
Member

I'm assuming you mean the var map = this.maps[this.api]; pattern here.

The challenge here is that the Mapstraction objects are disconnected from the "native" objects so holding a reference to the native object is a bit dodgy as the provider may have been swapped and you're now pointing to the wrong object.

Something to consider is that, whilst the "swap" feature is nice, I'm not sure who actually uses it and maybe that's costing unnecessary complexity and not providing much benefit.

@vicchi
Copy link
Member

vicchi commented Dec 4, 2013

The challenge here is that the Mapstraction objects are disconnected from the "native" objects so holding a reference to the native object is a bit dodgy as the provider may have been swapped and you're now pointing to the wrong object.

That's helpful. One of the things @gilesc50 and I have discussed is tidying up the namespacing and core way that Mapstraction works. This will help that.

Something to consider is that, whilst the "swap" feature is nice, I'm not sure who actually uses it and maybe that's costing unnecessary complexity and not providing much benefit.

True. Of course, it'd also be nice if we could know who is actually using Mapstraction but interest is continuing from outside of the project so for now that's about all the validation we have.

That said, to me the provider swapping is the key feature and attraction of Mapstraction. If we loose that, we're just a bunch of glorified API wrappers. I wouldn't want to loose this feature unless there's really no other way.

Also, nice to see you back and commenting here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants