Review main Merged

58287[TASK] Make DataMapper not a singleton

Tymoteusz Motylewski CR +2 V +2 Hard +165 −122 updated 09/20/18, 17:41

Commit message

DataMapper is not a singleton any more. Thanks to that, a further
refactoring can be done to pass aggregate root query configuration
to the DataMapper, which will allow to fix inconsistencies
in Extbase language handling.

The runtime cache of data maps is moved to DataMapFactory.

Review

  • Code review CR +2
    • Markus Klein +2
    • Christian Kuhn +1
  • Verified V +2
    • Markus Klein +2
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 16

Review log 4262

Show 2637 earlier messages
  1. Tymoteusz Motylewski uploaded patch set 1 09/15/18, 19:16

  2. TYPO3com voted on patch set 1 V +1 09/15/18, 19:26 Completed build in 10m 07s on Sat, 15 Sep, 09:26 PM Test Summary: 35905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28137

  3. Tymoteusz Motylewski uploaded patch set 2 09/15/18, 19:38

  4. Tymoteusz Motylewski commented on patch set 2 CR -1 09/15/18, 19:46

    I'm going through places where datamapper was injected
  5. TYPO3com voted on patch set 2 V -1 09/15/18, 19:48 Completed build in 09m 09s on Sat, 15 Sep, 09:48 PM Test Summary: 3 of 36253 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28138

  6. Tymoteusz Motylewski uploaded patch set 3 09/15/18, 20:13

  7. TYPO3com voted on patch set 3 V +1 09/15/18, 20:22 Completed build in 08m 16s on Sat, 15 Sep, 10:21 PM Test Summary: 35905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28139

  8. Tymoteusz Motylewski commented on patch set 3 09/15/18, 22:53

    reviews are welcome, to check if this is an acceptable way to achieve non singleton of dataMapper. But please don't merge it yet, as I'm still investigating whether this is the best way to go.
  9. Markus Klein updated the commit message in patch set 4 09/16/18, 07:52

  10. TYPO3com voted on patch set 4 V +1 09/16/18, 08:03 Completed build in 10m 18s on Sun, 16 Sep, 10:03 AM Test Summary: 35905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28149

  11. Markus Klein voted on patch set 4 CR +1 09/16/18, 08:44

  12. Wouter Wolters voted on patch set 4 CR +1 09/16/18, 10:14

  13. Georg Ringer voted on patch set 4 V +1 CR +1 09/16/18, 18:47

  14. Benni Mack updated the commit message in patch set 5 09/16/18, 19:01

  15. TYPO3com voted on patch set 5 V +1 09/16/18, 19:14 Completed build in 12m 33s on Sun, 16 Sep, 09:14 PM Test Summary: 35905 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28191

  16. Benni Mack voted on patch set 5 CR +1 09/16/18, 19:40

  17. Markus Klein voted on patch set 5 CR +1 09/16/18, 22:41

  18. Benni Mack voted on patch set 5 V +1 09/17/18, 09:11

  19. Christian Kuhn voted on patch set 5 V +1 CR +1 09/17/18, 13:00

  20. Christian Kuhn voted on patch set 5 V 0 CR 0 09/17/18, 13:05

  21. Tymoteusz Motylewski commented on patch set 5 CR -1 09/17/18, 13:10

    I'll do a final review this evening
  22. Christian Kuhn commented on patch set 5 09/17/18, 13:12

    it needs to be checked if DataMapper is injected into some singleton somewhere. Container would log this as 'bad code smell'
  23. Tymoteusz Motylewski rebased onto patch set 6 09/17/18, 13:33

  24. TYPO3com voted on patch set 6 V +1 09/17/18, 13:45 Completed build in 12m 21s on Mon, 17 Sep, 03:45 PM Test Summary: 35930 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28230

  25. Benni Mack commented on patch set 6 09/17/18, 13:47

    @lolli: it is. within Typo3DbBackend (also a singleton) - which is bad code smell already ;)
  26. Tymoteusz Motylewski voted on patch set 6 CR -2 09/17/18, 13:51

  27. Tymoteusz Motylewski uploaded patch set 7 09/17/18, 15:47

  28. TYPO3com voted on patch set 7 V -1 09/17/18, 15:48 Completed build in 13s on Mon, 17 Sep, 05:48 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28238

  29. Tymoteusz Motylewski uploaded patch set 8 09/17/18, 15:48

  30. TYPO3com voted on patch set 8 V -1 09/17/18, 15:56 Completed build in 07m 57s on Mon, 17 Sep, 05:56 PM Test Summary: 87 of 36281 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28239

  31. Tymoteusz Motylewski uploaded patch set 9 09/17/18, 19:39

  32. TYPO3com voted on patch set 9 V -1 09/17/18, 19:50 Completed build in 10m 41s on Mon, 17 Sep, 09:50 PM Test Summary: 69 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28244

  33. Tymoteusz Motylewski uploaded patch set 10 09/19/18, 09:53

  34. TYPO3com voted on patch set 10 V -1 09/19/18, 09:53 Completed build in 13s on Wed, 19 Sep, 11:53 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28338

  35. Tymoteusz Motylewski uploaded patch set 11 09/19/18, 10:13

  36. Tymoteusz Motylewski uploaded patch set 12 09/19/18, 10:15

  37. TYPO3com voted on patch set 11 V -1 09/19/18, 10:22 Completed build in 09m 22s on Wed, 19 Sep, 12:22 PM Test Summary: 684 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28341

  1. Tymoteusz Motylewski uploaded patch set 13 09/19/18, 10:23

  2. TYPO3com voted on patch set 12 V -1 09/19/18, 10:28 Completed build in 12m 42s on Wed, 19 Sep, 12:28 PM Test Summary: 654 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28342

  3. TYPO3com voted on patch set 13 V -1 09/19/18, 10:33 Completed build in 09m 38s on Wed, 19 Sep, 12:33 PM Test Summary: 636 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28343

  4. Tymoteusz Motylewski uploaded patch set 14 09/19/18, 11:24

  5. TYPO3com voted on patch set 14 V -1 09/19/18, 11:24 Completed build in 09s on Wed, 19 Sep, 01:24 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28352

  6. Tymoteusz Motylewski uploaded patch set 15 09/19/18, 11:26

  7. TYPO3com voted on patch set 15 V -1 09/19/18, 11:35 Completed build in 08m 48s on Wed, 19 Sep, 01:35 PM Test Summary: 591 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28353

  8. Tymoteusz Motylewski uploaded patch set 16 09/19/18, 12:11

  9. TYPO3com voted on patch set 16 V -1 09/19/18, 12:21 Completed build in 09m 43s on Wed, 19 Sep, 02:21 PM Test Summary: 549 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28360

  10. Tymoteusz Motylewski uploaded patch set 17 09/19/18, 12:57

  11. TYPO3com voted on patch set 17 V -1 09/19/18, 13:08 Completed build in 11m 07s on Wed, 19 Sep, 03:08 PM Test Summary: 12 of 36278 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28369

  12. Tymoteusz Motylewski uploaded patch set 18 09/19/18, 13:40

  13. TYPO3com voted on patch set 18 V +1 09/19/18, 13:54 Completed build in 11m 40s on Wed, 19 Sep, 03:54 PM Test Summary: 35930 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28374

  14. Tymoteusz Motylewski commented on patch set 18 CR 0 09/19/18, 14:10

    ready for review
  15. Markus Klein voted on patch set 18 V +1 CR +1 09/19/18, 15:55

  16. Benjamin Franzke commented on patch set 18 09/20/18, 04:47

    LazyLoadingProxy.php:71

    What is the reason for using initializeObject instead of injectDataMapper (as it was before) to retrieve the DataMapper? Implicit dependencies using this service locator pattern are worse than explicit inject* dependencies/methods. Do you use that because of the "bad code smell" warning from the Extbase Container when injecting non-singletons into singletons? (which would not apply here, as LazyLoadingProxy is not a singleton, it's the same for other classes as well: LazyObjectStorage, QueryResult, Typo3DbQueryParser) I know it "always" feels strange to inject protypes (non-singletons) and to rely on the container creating a new instance for every class injecting a prototype. Anyway, to be to "pass aggregate root query configuration to the DataMapper" initializeObject() may still be used if DataMapper receives a setter for that. But after all, especially when planing to extend the DataMapper to be initialized with state (later on), maybe better have a DataMapperFactory then?
  17. Tymoteusz Motylewski commented on patch set 18 09/20/18, 08:17

    LazyLoadingProxy.php:71 Reply Unresolved

    Hi Benjamin, Thanks for the review. I don't have a strong opinion on that. As you see in the patch history I fiddled with multiple approaches. First I kept inject menthods and remove them just for singletons. Then I changed it as at later step I would need to pass additional param to datamapper constructor, so I've moved the initalization to constructor. This however resulted in missing mocking in many tests, so I've moved to initialize object. But As you already mentioned, this approach is almost no different than keeping inject menthods. The only difference is that initialize is called after constructor and injections. I don't know yet where and whether I would need to pass stuff to datamaper in lazyloadingproxy, so I cant tell which approach is better now. The bottom line is that if you strongly prefer to keep inject methods, then I can reintroduce them.
  18. Benjamin Franzke commented on patch set 18 09/20/18, 09:21

    As I see in the "main" patch https://review.typo3.org/c/53974/84 you'll need it in initializeObject(). So let's at least get rid of retrieving the ObjectManager using GeneralUtility::makeInstance and use inject for that one. I still think a DataMapperFactory would be better, but that can be added later on.
  19. Tymoteusz Motylewski uploaded patch set 19 09/20/18, 11:47

  20. TYPO3com voted on patch set 19 V +1 09/20/18, 11:57 Completed build in 09m 46s on Thu, 20 Sep, 01:57 PM Test Summary: 36017 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28450

  21. Christian Kuhn rebased onto patch set 20 09/20/18, 13:52

  22. TYPO3com voted on patch set 20 V +1 09/20/18, 14:10 Completed build in 16m 44s on Thu, 20 Sep, 04:10 PM Test Summary: 36095 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28468

  23. Christian Kuhn voted on patch set 20 V +1 CR +1 09/20/18, 15:06

  24. Markus Klein voted on patch set 20 V +2 CR +2 09/20/18, 17:41

  25. Markus Klein merged patch set 21 09/20/18, 17:41