Project

General

Profile

task #9253

revise OccurrenceServiceImpl.findFieldUnitDTO(..)

Added by Andreas Kohlbecker about 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
10/15/2020
Due date:
% Done:

100%

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() Closed 08/12/2019
Related to Edit - bug #8423: OccurrenceServiceImpl.findFieldUnitDTO() fails to merge derivation paths when a FieldUnit has two derivatives Closed 07/30/2019
Related to Edit - task #9252: Harmonize SpecimenOrOberservationBase related DTOs Closed 10/14/2020
Related to Edit - task #8419: harmonization of the different specimen representations In Progress 07/25/2019
Related to Edit - bug #9257: revise filtering in OccurrenceServiceImpl.assembleFieldUnitDTO(FieldUnit fieldUnit) by SpecimenOrObservationType.PreservedSpecimen Closed 10/15/2020
Related to Edit - feature request #7704: Dataportal specimen table should be able to show DerivedUnits without a FieldUnit Closed 08/30/2018
Related to Edit - bug #9556: occurrence/{uuid}/fieldUnitDTOs web service adds duplicate units to response Closed 03/25/2021
Copied to Edit - task #9430: revise OccurrenceServiceImpl._findRootUnitDTO(..) supports multiple origin paths New 10/15/2020
Copied to Edit - task #9431: OccurrenceServiceImpl._findRootUnitDTO(..) New 10/15/2020

Associated revisions

Revision ddef3633 (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #9253 todo comment

Revision b1a675d1 (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #8423 ref #9253, ref #9252 fixing duplicate addition of DerivedUnitDTOs

Revision 5d299395 (diff)
Added by Andreas Kohlbecker about 1 year ago

ref #9253 cleaning up caller of OccurrenceServiceImpl.findFieldUnitDTO(..)

Revision ba48bce0 (diff)
Added by Andreas Kohlbecker 12 months ago

ref #9253 removing initstrategy from DTO service method

Revision 398413cc (diff)
Added by Andreas Kohlbecker 12 months ago

ref #9253 removing initstrategy from DTO service method - cleaning up

Revision aa1fe054 (diff)
Added by Andreas Kohlbecker 9 months ago

ref #9253 removing useless init strategy from within @Transactional method

History

#1 Updated by Andreas Kohlbecker about 1 year ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker about 1 year ago

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

#3 Updated by Andreas Kohlbecker about 1 year ago

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

#4 Updated by Andreas Kohlbecker about 1 year ago

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

#5 Updated by Andreas Kohlbecker about 1 year ago

  • Related to task #8419: harmonization of the different specimen representations added

#6 Updated by Andreas Kohlbecker about 1 year ago

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

#7 Updated by Andreas Kohlbecker about 1 year ago

  • % Done changed from 0 to 40

#8 Updated by Andreas Kohlbecker about 1 year ago

  • Status changed from New to In Progress

#9 Updated by Andreas Kohlbecker 11 months ago

  • Description updated (diff)

#10 Updated by Andreas Kohlbecker 11 months 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);

#11 Updated by Andreas Kohlbecker 11 months ago

  • Target version changed from Release 5.18 to Release 5.19

more TODO:

revise commented code and clean up

#12 Updated by Andreas Kohlbecker 11 months 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.

#13 Updated by Andreas Kohlbecker 11 months ago

  • Description updated (diff)

updating description with latest TODOs

#14 Updated by Andreas Kohlbecker 9 months ago

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

#15 Updated by Andreas Kohlbecker 9 months ago

  • Status changed from In Progress to Resolved

possibly solved now

#16 Updated by Andreas Kohlbecker 9 months ago

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

#17 Updated by Andreas Kohlbecker 9 months ago

  • Description updated (diff)

#18 Updated by Andreas Kohlbecker 9 months ago

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

#19 Updated by Andreas Kohlbecker 9 months ago

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

#20 Updated by Andreas Kohlbecker 7 months ago

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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)