holyturt / SwiftOverpassWrapper

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

Refactoring: Change `OverpassQuery` structure #8

Closed holyturt closed 6 years ago

holyturt commented 6 years ago

This branch attempts to change OverpassQuery and its related classes to avoid user to make wrong query relationships. Especially, it:

// after let node = NodeQuery() let way = node.way()


- expresses relationships with mixins like below:
```swift
class NodeQuery: OverpassQuery, WayReferable, RelationReferable {
    // contains: way(_:), relation(_:)
}

class RelationQuery: OverpassQuery, NodeReferable, WayReferable, RelationReferable, 
 BackwardsReferable {
    // contains: node(_:), way(_:), relation(_:), backwards(_:)
}

This will have breaking changes and incompatibilities. Any ideas?

wtimme commented 6 years ago

Hey @holyturt,

Great to see your changes! I was on vacation the last couple of weeks, and just saw the pull request. I'll be going through the files and add comments as I go along, just like I would during a code review. If you have any questions, suggestions or remarks, or if you have any ideas for the process, please comment.

holyturt commented 6 years ago

Hey, @wtimme! Thank you for your review! That’s very helpful. I will merge this PR with confidence!