Review main Merged

70061[TASK] Deprecate generic extbase domain classes

Christian Kuhn CR +2 V +2 Expert +998 −110 updated 03/14/22, 18:13

Commit message

Extbase provides a couple of generic domain repositories
and models, especially frontend / backend users and
groups. Those are flawed by design:

The main issue is that domain models have to be specific
for the domain they are used in. By definition, a generic,
opinionated model can't be "correct" since the domain
it is used in, is unique: It might be that a backend user
email has to be set and the domain does not model
anything but email and firstname?

Many usages don't need backend groups attached to a
backend user model at all, or if they need them, then
maybe in a recursive presentation, or a specific order
or something similar. Having a default group resolution
is thus at least misleading, if not wrong, and can be a
performance issue on top.

A generic model can never foresee its usages. The existing
models thus try to 1:1 adapt the database fields, which
is also misleading since a domain model is not and should
not be a direct representation of a database table. It
would only be by chance if the generic models fit a
specific domain.

Similar issues exist with the repositories: The
CategoryRepository for instance assumes it is a good
idea to set respectStoragePid(false), which is most
likely not the right thing for an extension use.
In the end, whatever extbase delivers here, is most
likely wrong and does not fit the problem domain.

The patch keeps the 'experimental' FAL related models
since those can be actually useful for extensions and
their final fate has not been decided, yet. The other
generic models, especially those with lots of properties
are marked as deprecated with the patch.

Review

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

Issues 2

Files 37

Show 17 more files

Review log 1419

  1. Christian Kuhn uploaded patch set 1 07/23/21, 15:07

  2. core-ci voted on patch set 1 V -1 07/23/21, 15:25 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13694

  3. Christian Kuhn uploaded patch set 2 07/23/21, 15:53

  4. core-ci voted on patch set 2 V -1 07/23/21, 16:08 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13697

  5. Christian Kuhn uploaded patch set 3 07/26/21, 14:49

  6. core-ci voted on patch set 3 V -1 07/26/21, 15:17 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13763

  7. Christian Kuhn uploaded patch set 4 07/28/21, 11:59

  8. core-ci voted on patch set 4 V +1 07/28/21, 12:09 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/13841

  9. Benni Mack commented on patch set 4 07/29/21, 11:18

    I would argue to keep at least Category Domain Model. Why? Because it's mostly used as relation and used widely (more than others), a similar thing is the FrontendUser object, which I've seen quite often in the wild, but there - only parts were used.
  10. Christian Kuhn commented on patch set 4 07/29/21, 12:18

    Reply

    I dropped Category mostly because the CategoryRepository is so misleading with the respectStoragePid thing, I don't care too much about Category, though - it's a small model and the 'tree' is lazy ... could be kept if wanted. I didn't deprecate the FAL related things for a similar reason. But the 'repository root' CategoryRepository should vanish. For FrontendUser though, I'm strongly +1 for the deprecation: That's a huge data model that "never" fits. What do you think?
  11. Christian Kuhn uploaded patch set 5 07/29/21, 15:28

  12. Christian Kuhn commented on patch set 5 07/29/21, 15:29

    Reply

    Aligned with benni: don't deprecate Category but still deprecate FrontendUser.
  13. core-ci voted on patch set 5 V +1 07/29/21, 15:50 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/13886

  14. Benni Mack voted on patch set 5 V +1 CR +1 08/02/21, 08:53

  15. Oli Bartsch voted on patch set 5 V +1 CR +1 08/02/21, 15:14

  16. Christian Kuhn voted on patch set 5 V +2 CR +2 08/02/21, 15:21

  17. Christian Kuhn merged patch set 6 08/02/21, 15:22

  18. C. Gogolin commented on patch set 6 03/13/22, 12:35

    Hello all, I am trying to make my Typo3 10 extensions fit for Typo3 version 11. Now I came across this change and I don't understand how to rebuild my extensions. The migration hint was not very helpful. Example: The frontend groups should get a list of other frontend groups. In this case it is about other domain hierarchy than it can be mapped with the subgroups. The editors should simply be able to select the groups at the corresponding frontend group via a multi-selection field. With version 10: - Derivation of the model and the repository with the 1-n extension to the other FE groups. - In the conroller you can use the derived repository and have the properties of the group + my new 1:n relationship to other groups. - Since the relationship is based on my new model, I can walk briskly through the tree and be happy.... - by extending the fe_groups model it is also easy for editors to maintain. At the latest from version 12: - No derivation of the model and the repository. - There is only the mm table. Should I create a repository for it? Is that possible? - and then? Here I no longer understand how it should go on? I can imagine that the editors in BE have to create more (mm) records separately. Which makes the whole thing much more difficult for the editors. Too times there is not only one extension. There are at least three extensions that store additional user information. (e.g. settings from the user profile) If all this has to be stored in separate tables, then I can hear the cursing of the editors, because the whole thing is so complicated: Before everything was nice and clear with each FE user together. But after the changeover, there are umpteen BE data records. And what I do not understand at all: If the "generic" FrontUser model is removed completely, one must write then everything the fe_user table itself, in order to come to the Meta data? Or will the user metadata also be removed without replacement? There are a lot of question marks buzzing above my head.... Please give me an information, how to future philosophy should be and not only that the existing can not be correct and therefore must be gone... I could understand if the meta data attributes are canceled, because that is just "guessing" what Typo3 system need. But the whole frontend user model? I'm at a loss... Greetings Clemens Translated with www.DeepL.com/Translator (free version) --- Deutsch: Hallo zusammen, ich versuche meine Typo3 10 Erweiterungen fit für Typo3 Version 11 zumachen. Jetzt bin ich auf diese Veränderung gestoßen und verstehe ich nicht, wie ich meine Erweiterungen umbauen soll. Der Migrationshinweis war nicht sehr hilfreich. Ein Beispiel: Die Frontend-Gruppen sollen eine Liste von anderen Frontendgruppen erhalten. In diesem Fall geht es um andere fachliche Hierarchie als es mit den subgroups abbildbar ist. Die Redakteure sollen einfach bei der entsprechenden Frontend-Gruppe über ein Multi-Selektionsfeld die Gruppen auswählen können. Bei Version 10: - Ableitung des Models und des Repositories mit der 1-n-Erweitund auf die andere FE-Gruppen - Im Conroller kann das abgeleitete Repository verwenden und habe so die Eigenschaften der Gruppe + die meine neue 1:n Beziehung zu anderen Gruppen - Da die Beziehung auf meinem neuen Model basiert, kann ich zügig den Baum durch wandern und glücklich sein... - durch die Erweiterung des fe_groups-Model ist es auch einfach für die Redakteure zu pflegen. Spätestens ab Version 12: - Keine Ableitung des Models und des Repositories. - Es gibt nur die mm-Tabelle. Soll ich dafür ein Repository erstellen? Geht das? - und dann? Hier verstehe ich nicht mehr wie es weiter gehen soll? Ich kann mir vorstellen, dass die Redakteure in BE noch weitere (mm-)Datensätze separat anlegen müssen. Was das ganze sehr viel schwieriger für die Redakteure macht. Zu mal es nicht nur eine Erweiterung gibt. Es gibt alleine mindestens drei Erweiterungen, die zusätzliche Nutzerinformationen ablegen. (bspw. Einstellungen aus den Nutzerprofil) Wenn das alles in separate Tabellen muss, dann kann ich das Fluchen der Redakteure schon hören, weil das ganze so kompliziert ist: Vorher war alles schön übersichtlich bei jedem FE-Nutzer zusammen. Aber nach der Umstellung zig BE-Datensätze. Und was ich gar nicht verstehe: Wenn das "generische" FrontUser-Model ganz entfernt wird, muss man dann alles die fe_user-Tabelle selber schreiben, um an die Meta-Daten zu kommen? Oder werden die Nutzer-Metadaten auch ersatzlos gestrichen? Über meinem Kopf schwirren viele Fragezeichen... Bitte geben Sie mir eine Auskunft, wie zu zukünftige Philosophie sein soll und nicht nur dass das bestehende nicht richtig sein kann und darum weg muss... ich könnte verstehen, wenn die Meta-Datenattribute aufgekündigt werden, weil das ja nur "raten" ist, was Typo3-System benötigen. Aber das ganze Frontend-User-Model? Ich bin ratlos... Grüße Clemens
  19. Torben Hansen commented on patch set 6 03/14/22, 18:13

    Reply

    Hi Clemens, the TYPO3 patch review system (gerrit) might be the wrong place to ask for information/help about changes in TYPO3 core. I recommend that you switch to either stackoverflow, TYPO3 Slack or TYPO3 Facebook groups and ask your question(s) on one of those platforms.