Review main Merged

85047[TASK] Use a Identity Map for Record objects

Benni Mack CR +2 V +2 Normal +126 −72 updated 07/11/24, 22:25

Commit message

When loading Record objects, and we use Relations
in one of the next patches, the main issue will
be that we might run in recursions when fetching
relations. This can be resolved by re-using created
Record objects by utilizing the
Identity Map pattern (https://en.wikipedia.org/wiki/Identity_map_pattern)
which keeps track (context-wise) of the loaded
records.

In a way to unify this logic, the "RecordRememeberer"
for Page Module has now been removed as this
is the exact purpose of the Identity Map.

The next step is to actually utilize the Record
API in the Page module replacing arrays there completely.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Oliver Hader +1
    • core-ci +1 CI

Issues 2

Files 9

Review log 1524

  1. Benni Mack uploaded patch set 1 07/01/24, 14:24

  2. core-ci voted on patch set 1 V -1 07/01/24, 14:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60775

  3. Benni Mack updated the commit message in patch set 2 V -1 07/01/24, 15:04

  4. core-ci voted on patch set 2 V -1 07/01/24, 15:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60782

  5. Oliver Hader uploaded patch set 3 V -1 07/11/24, 16:34

  6. core-ci voted on patch set 3 V +1 07/11/24, 16:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61398

  7. Oliver Hader uploaded patch set 4 V +1 07/11/24, 17:03

  8. core-ci voted on patch set 4 V +1 07/11/24, 17:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61399

  9. Benni Mack uploaded patch set 5 V +1 07/11/24, 17:34

  10. core-ci voted on patch set 5 V +1 07/11/24, 17:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61402

  11. Benni Mack uploaded patch set 6 07/11/24, 18:25

    Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**")
  12. core-ci voted on patch set 6 V +1 07/11/24, 18:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61405

  13. Christian Kuhn commented on patch set 6 07/11/24, 19:56

    RecordIdentityMap.php:64

    i think be much better if the signature would is: public function findByIdentifier(string $mainType, int $identifier): RecordInterface and public function hasIdentifier(string $mainType, int $identifier): bool reason: we should not have these fallbacks in this class: it is job of the consumer to see if it has a 'valid' record at hand, and to then ask this class for a resolved record?
  14. Benni Mack rebased onto patch set 7 V +1 07/11/24, 20:44

  15. Benni Mack uploaded patch set 8 07/11/24, 20:48

  16. Benni Mack commented on patch set 8 07/11/24, 20:48

    RecordIdentityMap.php:64 Reply

    Done
  17. core-ci voted on patch set 7 V +1 07/11/24, 20:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61414

  18. core-ci voted on patch set 8 V -1 07/11/24, 20:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61416

  19. Benni Mack uploaded patch set 9 V -1 07/11/24, 21:00

  20. core-ci voted on patch set 9 V +1 07/11/24, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61417

  21. Oliver Hader commented on patch set 9 CR +1 V +1 07/11/24, 22:03

    RecordIdentityMap.php:69

    Exception, phew... Well... let's move on... ;-)
  22. Christian Kuhn voted on patch set 9 CR +1 V +1 07/11/24, 22:16

  23. Benni Mack voted on patch set 9 CR +2 V +2 07/11/24, 22:25

  24. Benni Mack merged patch set 10 07/11/24, 22:25