Project

General

Profile

Actions

task #9253

closed

revise OccurrenceServiceImpl.findFieldUnitDTO(..)

Added by Andreas Kohlbecker about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Tags:

Description

This intended function of FieldUnitDTO OccurrenceServiceImpl.findFieldUnitDTO(DerivateDTO derivedUnitDTO, Collection<FieldUnitDTO> fieldUnits, HashMap<UUID, DerivateDTO> alreadyCollectedSpecimen) is quite unclear, not only because the documentation is missing (#8458), but also since the method is confuses reagarding the method signature: All detected fieldunits are added to the Collection<FieldUnitDTO> fieldUnits passed as parameter but one of the field units is returned. From the description of #8423 supports the impression that this method covers two distinct functionalities at the same.

TODO:

  • refactor the method to make its clarify its purpose and concerns. - DONE
  • revise commented code and clean up
  • remove the init strategy (first FIXME in code) - DONE
  • allow for walking multiple origin paths (second FIXME in code) ---> #9430
  • The methods OccurrenceServiceImpl._findFieldUnitDTO and OccurrenceServiceImpl.findFieldUnitDTO() are operating on DTOs. This causes a computation overhead which could be significant in cases where intermediate derivation events exists. The creation of the DTOs is quite expensive since they are relatively complex objects for which quite some entity initialization is necessary. It would be better to do the search for field units purely on the entity level and to create DTOs in a final step only for those entities which are needed for the out put or response. ---> #9431

Related issues

Related to EDIT - task #8458: document FieldUnitDTOOccurrenceServiceImpl.findFieldUnitDTO()ClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #8423: OccurrenceServiceImpl.findFieldUnitDTO() fails to merge derivation paths when a FieldUnit has two derivativesClosedAndreas Kohlbecker

Actions
Related to EDIT - task #9252: Harmonize SpecimenOrOberservationBase related DTOsClosedAndreas Kohlbecker

Actions
Related to EDIT - task #8419: Harmonization of the different specimen representationsIn ProgressAndreas Kohlbecker

Actions
Related to EDIT - bug #9257: revise filtering in OccurrenceServiceImpl.assembleFieldUnitDTO(FieldUnit fieldUnit) by SpecimenOrObservationType.PreservedSpecimenClosedAndreas Kohlbecker

Actions
Related to EDIT - feature request #7704: Dataportal specimen table should be able to show DerivedUnits without a FieldUnitClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #9556: occurrence/{uuid}/fieldUnitDTOs web service adds duplicate units to responseClosedAndreas Kohlbecker

Actions
Copied to EDIT - task #9430: revise OccurrenceServiceImpl._findRootUnitDTO(..) supports multiple origin pathsNewAndreas Kohlbecker

Actions
Copied to EDIT - task #9431: OccurrenceServiceImpl._findRootUnitDTO(..) NewAndreas Müller

Actions
Actions #1

Updated by Andreas Kohlbecker about 2 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Kohlbecker about 2 years ago

  • Related to task #8458: document FieldUnitDTOOccurrenceServiceImpl.findFieldUnitDTO() added
Actions #3

Updated by Andreas Kohlbecker about 2 years ago

  • Related to bug #8423: OccurrenceServiceImpl.findFieldUnitDTO() fails to merge derivation paths when a FieldUnit has two derivatives added
Actions #4

Updated by Andreas Kohlbecker about 2 years ago

  • Related to task #9252: Harmonize SpecimenOrOberservationBase related DTOs added
Actions #5

Updated by Andreas Kohlbecker about 2 years ago

  • Related to task #8419: Harmonization of the different specimen representations added
Actions #6

Updated by Andreas Kohlbecker about 2 years ago

  • Related to bug #9257: revise filtering in OccurrenceServiceImpl.assembleFieldUnitDTO(FieldUnit fieldUnit) by SpecimenOrObservationType.PreservedSpecimen added
Actions #7

Updated by Andreas Kohlbecker about 2 years ago

  • % Done changed from 0 to 40
Actions #8

Updated by Andreas Kohlbecker about 2 years ago

  • Status changed from New to In Progress
Actions #9

Updated by Andreas Kohlbecker almost 2 years ago

  • Description updated (diff)
Actions #10

Updated by Andreas Kohlbecker almost 2 years ago

there are two open FIXMEs in the method:

// FIXME defining propertyPaths inside of transactional service method makes no sense. see also #9253
propertyPaths.add("descriptions.elements.media.title");
propertyPaths.add("kindOfUnit");
propertyPaths.add("derivedFrom");
// FIXME allow handling multiple originals
SpecimenOrObservationBase<?> original = originals.get(0);
Actions #11

Updated by Andreas Kohlbecker almost 2 years ago

  • Target version changed from Release 5.18 to Release 5.19

more TODO:

revise commented code and clean up

Actions #12

Updated by Andreas Kohlbecker almost 2 years ago

.. and another one:

TODO: The methods OccurrenceServiceImpl._findFieldUnitDTO and OccurrenceServiceImpl.findFieldUnitDTO() are operating on DTOs. This causes a computation overhead which could be significant in cases where intermediate derivation events exists. The creation of the DTOs is quite expensive since they are relatively complex objects for which quite some entity initialization is necessary. It would be better to do the search for field units purely on the entity level and to create DTOs in a final step only for those entities which are needed for the out put or response.

Actions #13

Updated by Andreas Kohlbecker almost 2 years ago

  • Description updated (diff)

updating description with latest TODOs

Actions #14

Updated by Andreas Kohlbecker almost 2 years ago

  • Related to feature request #7704: Dataportal specimen table should be able to show DerivedUnits without a FieldUnit added
Actions #15

Updated by Andreas Kohlbecker almost 2 years ago

  • Status changed from In Progress to Resolved

possibly solved now

Actions #16

Updated by Andreas Kohlbecker almost 2 years ago

  • Copied to task #9430: revise OccurrenceServiceImpl._findRootUnitDTO(..) supports multiple origin paths added
Actions #17

Updated by Andreas Kohlbecker almost 2 years ago

  • Description updated (diff)
Actions #18

Updated by Andreas Kohlbecker almost 2 years ago

  • Copied to task #9431: OccurrenceServiceImpl._findRootUnitDTO(..) added
Actions #19

Updated by Andreas Kohlbecker almost 2 years ago

  • Description updated (diff)
  • Status changed from Resolved to Closed
  • % Done changed from 40 to 100
Actions #20

Updated by Andreas Kohlbecker over 1 year ago

  • Related to bug #9556: occurrence/{uuid}/fieldUnitDTOs web service adds duplicate units to response added
Actions

Also available in: Atom PDF