-
Notifications
You must be signed in to change notification settings - Fork 191
NotImplementedExceptions in FeatureCollection #339
Comments
NotImplementedException is most likely wrong and should be not supported exception. |
I'm not sure that's an improvement. Why not adjust IFeatureCollection, which is literally in the same project and folder, to match FeatureCollection's capabilities (or vice versa). Yes, IFeatureCollection inherits from a collection interface, but if that collection interface has too many features, choose a different collection interface to inherit from. Otherwise this is violating Liskov Substitution Principle and resulting in extra bloat in FeatureCollection. |
Those methods are all inherited from IDictionary. They weren't implemented because nobody needed them yet. We never attempt to consume the collection as an IDictionary and I don't think we need anything beyond TryGetValue and Set/indexer. Recommendation: Remove IDictionary from IFeatureCollection and just add the methods we need. |
@Tratcher +1 to your recommendation. |
Makes sense to me too. |
/cc @lodejard |
@Tratcher We want to preserve enumeration also. |
Yep, it started as a get/set interface and dictionary was added when enumeration was needed. Out of curiosity, would it make sense to implement the idictionary interface instead of declaring a get/set/enumerable subset? |
IDictionary has 10x more functionality/complexity than we need. This collection is also never exposed directly to the application, it only exists between the server and Hosting/DefaultHttpContext. I'm drafting a subset API list now, but so far the only APIs we actually use are Get and Set. Enumeration is a nice to have, but it's not actually used anywhere or available to the app. Keeping the surface area to a minimum also makes implementing #353 so much easier and more efficient. |
I agree, but lets keep enumeration (of Type) available to support diagnostic scenarios of displaying all features and writing out all reflected properties. Sent from mobile device From: Chris Rmailto:[email protected] IDictionary has 10x more functionality/complexity than we need. This collection is also never exposed directly to the application, it only exists between the server and Hosting/DefaultHttpContext. I'm drafting a subset API list now, but so far the only APIs we actually use are Get and Set. Enumeration is a nice to have, but it's not actually used anywhere or available to the app. Keeping the surface area to a minimum also makes implementing #353#353 so much easier and more efficient. — |
Why does FeatureCollection have NotImplementedExceptions when it is implementing IFeatureCollection, for which one would expect perfect parity? If there are parts of that interface that FeatureCollection doesn't use, why are they on the interface?
The text was updated successfully, but these errors were encountered: