-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Improvement: A naming scheme that separates key GIS concerns #583
Comments
Thank you for sharing your idea and taking the time to clearly elaborate, what you are trying to achieve. Highly appreciate it! Here is my personal view on this topic. As we all now, "naming things" is one of the hardest parts of computer science. For sure there are guard rails, to properly name things, but it's not exactly black or white, right or wrong. Involved PartiesMapLibre React Native is at a very difficult cross road of these other libraries/topics (possibly incomplete):
We have to bring all these together and make a unified interface, which works in React Native for developers consuming this library. We also need make the right choices from mapping functionalities from MapLibre Native to React Native, so all contributors can understand which parts map to what on the other side. Which way do we want to go?As some of you may noticed, I've moved stuff around internally a lot the last months, to ease maintenance. I'm also not happy with some naming schemes. But I would like to steer those names in different direction. Let me make some examples:
In the mix of the named packages, we are the smallest puzzle piece. So we shouldn't try to introduce new naming schemes and rather reuse what's already there. Getting all those upstreams to use the same namings is somewhere close to impossible, it should still be possible to switch from Mapbox to MapLibre without starting from scratch. Let me explain one problem, where this library works specifically different then the rest of the ecosystem, which wouldn't be necessary. The style spec uses This example shows, it's not easy to change everything upstream. And I also dislike this library to have another way of doing things, then everyone else. My ProposalAs previously noted, our biggest criteria for how we name stuff should be (in this order):
Right now the components of this library tend to be named more aligned to how their counterparts in MapLibre Native are named. For me this seems to be more contributor centric, then consuming developers. My assumption is, that most MapLibre React Native consumers don't care to much about the native specifics, like a how a public component is mapped to native internals. They rather know MapLibre on the web and questions in this repository are often: "How to do this, like in maplibre-gl-js?". Therefore I want the naming of this library to lean more towards the web parts of MapLibre, which means MapLibre GL JS and the style spec. In fact there is a great React library for Important Don't expect this to equal web support. Moving in this direction would make this much easier, as we could just integrate with Concerning newcomers to GISI didn't go into much detail on this concern yet:
While I understand you intent on naming the components clearer, it also makes it quite verbose. And as previously state, I would avoid creating new terms which aren't use from other MapLibre libs. I think this could also be solved with better documentation. Like having the examples on a website, which would only need some text explaining what each example is trying to solve. This would make the examples also visible to search engines, which we are lacking in our current state. If we ever get web support, many of them could have a web preview. And in general, if this library get more traction, by just working great, we might also get more content around it, explaining how to apply it. Reducing documentation sounds nice as it would lower maintenance. But there is a sweet spot of the amount of docs a library need, so consumers can see what's possible or how the can achieve what the want to solve, and maintaining that documentation. tl;drI don't want to create a completely new interface and introduce names, which aren't yet much used within other MapLibre domains. I rather would like to unify all Sources and Layers to two components: |
Motivation
Naming is an important factor in designing for the SOLID principle of single-responsibility to produce readable & maintainable code, and to reduce the need for documentation. GIS best-practices also emphasize clear naming to assist developers newer to GIS or those transitioning from other GIS libraries.
MLRN is not a huge library by any means, but in my year of integrating MLRN in my app, at times I struggled to keep track of the tools available in the toolkit because of vague names like OfflineManager and ShapeSource. I've seen others raising issues rooted in misunderstanding the purposes of such implementations. I also believe that a clearer naming scheme will help with maintaining MLRN in the long-term.
I'd like to suggest that MLRN (and it's upstream libraries) move to a naming scheme that distinguishes the key GIS concerns of:
Example renaming for implementations focused on tiles:
Example renaming for implementations focused on features:
Example descriptive renaming for misc implementations:
What do you think?
The text was updated successfully, but these errors were encountered: