philvessey / NextDepartures

NextDepartures is a .NET Library that queries GTFS (General Transit Feed Specification) data sets stored locally or in an Azure SQL Database. The library will work with any well formed GTFS data set.
MIT License
1 stars 1 forks source link

Consider removing the Get* methods in Feed class where its only delegating to the data storage #16

Closed hypervtechnics closed 4 years ago

hypervtechnics commented 4 years ago

What do you think about this one? As the user is in charge of providing the storage he can also call the methods directly there, I think.

philvessey commented 4 years ago

I had a think about this - my initial thoughts are that if some endpoints, such as the services ones, still need to be called as an endpoint then to keep things simple they should all be endpoints - don't think it makes sense to have one way of calling some data and a different way of calling some other bit of data.

Unless I'm getting the wrong idea of what you are thinking?

hypervtechnics commented 4 years ago

You are right. Then maybe also make the feed an IDataStorage? This will ensure it has all the same capabilities as the storage + the service calculation

philvessey commented 4 years ago

Doesn't that mean adding in all the same methods into feed that are in the IDataStorage? Not sure what benefit that brings over the current approach?

hypervtechnics commented 4 years ago

Aren't they all there anyway?

philvessey commented 4 years ago

Changing all the:

public partial class Feed to public partial class Feed : IDataStorage

Reports errors that Feed doesn't implement interface members such as -> 'Feed' does not implement interface member 'IDataStorage.GetAgenciesAsync() unless you can see something that I'm missing.

philvessey commented 4 years ago

If you want to have a look your side if I'm missing something the dev branch is up to date so you can pull down the latest commits and make the changes.

hypervtechnics commented 4 years ago

Nevermind. Some methods are only available on the data storage. No complaints.