holyturt / SwiftOverpassWrapper

A wrapper of the Overpass API for Swift.
MIT License
16 stars 2 forks source link

Rename models #20

Open wtimme opened 6 years ago

wtimme commented 6 years ago

Since I'm using not only Overpass but also the OpenStreetMap API in my own app, I find the current elements naming scheme a bit misleading. What do you think about dropping the Overpass prefix for the classes, @holyturt? For example, OverpassNode would be called just Node.

Looking forward to your feedback!

holyturt commented 6 years ago

I feel the same way! It's little weird. Actually, I put the prefix on purpose because those words are very common. I wanted to avoid conflict between names. However, the compiler doesn't seem to care about it. Therefore, I agree with your suggestion. This should be added to to-do.

wtimme commented 6 years ago

Glad to hear!

What do you think about adding an OSM prefix to the OverpassElement subclasses, e. g. OSMNode? I plan on using these elements with both the Overpass API as well as the OSM REST API v0.6. Both APIs provide elements from OpenStreetMap, hence the prefix. This is what the renaming would look like:

What do you think?

As for the queries, I would leave the structure the way it is, since OverpassQuery and its subclasses are solely used with the Overpass API. For consistency's sake, I was thinking about renaming the subclasses to indicate their parent class:

Writing these down like that makes me think if there was an easier way to have namespacing, because that's basically what part of this is about. We could achieve this by moving code to different projects, e. g. one for the models (shared between Overpass and the client for the OpenStreetMap API), one for the commication with Overpass and, if we were to have an OpenStreetMap API client in this project (cp. #21), a third project for the API client.

So, should we rename everything and group the classes by adding prefixes, or should we create dedicated projects to have "natural" namespaces? I'm not that experienced with this kind of framework decisions, so I'm happy about any feedback, thought and input. Thanks in advance!

holyturt commented 6 years ago

Thank you and sorry for the late reply for this issue.

The prefix OSM and renaming for query models of Overpass API look appropriate for this project! In #21, we discussed whether we should split the project. I believe the way separating project is better. However this name change will fit for this project anyway. Therefore I think it's good to go along with your way.

What do you think, @wtimme?