Issue 11052

Remove or load name usage subresources

11052
Reporter: mdoering
Assignee: mdoering
Type: Improvement
Summary: Remove or load name usage subresources
Priority: Critical
Resolution: Fixed
Status: Closed
Created: 2012-05-07 13:28:55.205
Updated: 2013-12-09 13:40:53.083
Resolved: 2012-06-07 12:09:58.665
        
Description: Currently all sub resources of a name usage are not eagerly loaded. For example the synonyms of Puma concolor is an empty list:
http://staging.gbif.org:8080/checklistbank-ws/name_usage/2435099

While in fact there are 2 known synonyms:
http://staging.gbif.org:8080/checklistbank-ws/name_usage/2435099/synonyms

We should either remove the not loaded lists from the json or populate it with real data.]]>
    


Author: mdoering@gbif.org
Comment: Id be in favor of removing all lists from the NameUsage class but instead create a new subclass that has them, NameUsageWrapper or NameUsageFull
Created: 2012-06-01 15:39:16.898
Updated: 2012-06-01 15:39:16.898


Author: trobertson@gbif.org
Created: 2012-06-01 15:45:28.322
Updated: 2012-06-01 15:45:28.322
        
Why?  I'm not against the idea, but would like to know the rationale to comment.

On the names though, NameUsageWrapper is not a very intuitive name.  NameUsageFull would be better but still wonder why you'd want 2 representations.

Sub resources would be an alternative option:
  /checklistbank-ws/name_usage/2435099/references
  /checklistbank-ws/name_usage/2435099/synonyms
  /checklistbank-ws/name_usage/2435099/higherClassification
  etc


    


Author: mdoering@gbif.org
Created: 2012-06-02 14:33:27.616
Updated: 2012-06-02 14:33:27.616
        
the wrapper idea is just to have a class to hold the usage and all the data from its subresources after Ive done the secondary calls.
Its a very recurring pattern if you have to deal with more than just one name that you need a class to hold all infos together.

And removing sub resources and eagerly loading it always is definitely far too much in many cases
    


Author: mdoering@gbif.org
Comment: wrapper class finally is called NameUsageContainer
Created: 2012-06-07 12:09:58.714
Updated: 2012-06-07 12:09:58.714


Author: mdoering@gbif.org
Comment: And identifiers are loaded eagerly, all other sub resources not and are therefore removed from NameUsage
Created: 2012-06-07 12:10:32.085
Updated: 2012-06-07 12:10:32.085