You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question about the code relates to the search sub-package. I understand the need for the types sub-package, because each class in that sub-package encapsulates the metadata such as wfs and xml fields specific to each dataset type. However it's not quite clear to me why different classes are needed for the search objects that correspond to each type in the search package. Am I right that all the search classes have the exact same attributes and methods? My read of the code is that the only difference between the search classes is the default value for objecttype. E.g., a BoringSearch class has its objecttype default =Boring , which dictates what fields it has, but aside from that, it has the exact same methods as all the other search types. If I'm misunderstanding something about the code, please let me know and I'll just remove this question. But it seems like it might be possible to reduce code repetition by having another class that inherits from AbstractSearch with all the code that is common to the specific Search classes, and then just subclass this additional class for specific types.
I think this is a valid question, as there is quite some code duplication in the search classes. If I remember correctly this has something to do with the private class variables containing the WFS schema, metadata, XSD schema etc:
We want to avoid downloading this data multiple times even if a user creates multiple instances of the search class (hence they are class variables). The data is however specific to a certain type so cannot be moved to a base class..
I think there are two routes to evaluate:
Look into a clever way to keep this behaviour while still reducing some of the code duplication.
Let go the behaviour of keeping the data between multiple instances of the search classes. This would allow refactoring the class variables to instance variables which would facilitate moving duplicate code into the base class. Since the search instances don't persist data between searches anyway, this might be a valid option to consider.
The text was updated successfully, but these errors were encountered:
This might also relate to #281 as this will remove the major reason we implemented this shared data in the first place, which is to share the common (and large) WFS capabilities data between (instances of) search classes.
From the pyOpenSci review:
I think this is a valid question, as there is quite some code duplication in the search classes. If I remember correctly this has something to do with the private class variables containing the WFS schema, metadata, XSD schema etc:
We want to avoid downloading this data multiple times even if a user creates multiple instances of the search class (hence they are class variables). The data is however specific to a certain type so cannot be moved to a base class..
I think there are two routes to evaluate:
The text was updated successfully, but these errors were encountered: