Review main Merged

78012[TASK] Streamline ObjectMonitoring- and DomainObjectInterface usage

Alexander Schnitzler CR +2 V +2 Normal +40 −69 updated 03/07/23, 17:25

Commit message

ObjectMonitoringInterface is a signaling interface for extbase
internals to signal that an object state can be monitored. Its
main purpose is to tell the persistence manager if an object or
an object collection is so called dirty, i.e. if changes need to
be persisted or not.

This change lets DomainObjectInterface extend ObjectMonitoringInterface
instead of AbstractDomainObject. Abstract classes must never be external
api, they should just contain boilerplate/repetative code. With this
change extbase can perform actions based on implemented interfaces, i.e.
guaranteed functionality instead of checking object instances.

Review

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

Issues 1

Files 11

Review log 1417

  1. Alexander Schnitzler uploaded patch set 1 03/03/23, 07:59

  2. Alexander Schnitzler marked it work in progress 03/03/23, 08:00

  3. Alexander Schnitzler wrote 03/03/23, 08:02

    Topic set to extbase
  4. core-ci voted on patch set 1 V +1 03/03/23, 08:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38344

  5. Alexander Schnitzler commented on patch set 1 03/03/23, 08:25

    This change is ready for review.
  6. Oliver Klee commented on patch set 1 03/04/23, 13:13

    I really love this cleanup! Thanks for doing this! I've added some comments concerning tightening the types a bit more.

    AbstractDomainObject.php:156

    `@param non-empty-string`

    AbstractDomainObject.php:179

    `@param non-empty-string|null` … and use `string|null` as native type declaration

    AbstractDomainObject.php:253

    `@param non-empty-string|null` … and use `string|null` as native type declaration

    DomainObjectInterface.php:58

    `@param non-empty-string`

    ObjectMonitoringInterface.php:32

    `@param non-empty-string|null` … and use `string|null` as native type declaration

    ObjectMonitoringInterface.php:37

    `@param non-empty-string|null` … and use `string|null` as native type declaration

    ObjectStorage.php:335

    `@param non-empty-string|null` … and use `string|null` as native type declaration

    ObjectStorage.php:343

    `@param non-empty-string|null` … and use `string|null` as native type declaration
  7. Stefan Froemken commented on patch set 1 V +1 CR +1 03/06/23, 18:18

    AbstractDomainObject.php:179 Reply

    non-empty-string is OK, but if a property name is given, is is and should never be null. So just string is OK for me. Do not allow nullable property name here.

    AbstractDomainObject.php:253 Reply

    See my comment above
  8. Alexander Schnitzler commented on patch set 1 03/07/23, 09:53

    AbstractDomainObject.php:179 Reply

    No, Oli is right here. The `$propertyName` is only used on `ObjectStorage::_memorizeCleanState()`. On `AbstractDomainObject`s, we want to memorize the state of all properties. The interface cannot be too strict because of the implementation. Unfortunate but the better of two bad options.

    AbstractDomainObject.php:253 Reply

    dito
  9. Alexander Schnitzler uploaded patch set 2 CR +1 V +1 03/07/23, 15:42

  10. Alexander Schnitzler commented on patch set 2 03/07/23, 15:44

    AbstractDomainObject.php:156 Reply

    Done

    AbstractDomainObject.php:179 Reply

    Done

    AbstractDomainObject.php:253 Reply

    Done

    DomainObjectInterface.php:58 Reply

    Done

    ObjectMonitoringInterface.php:32 Reply

    Done

    ObjectMonitoringInterface.php:37 Reply

    Done

    ObjectStorage.php:335 Reply

    Done

    ObjectStorage.php:343 Reply

    Done
  11. Oliver Klee commented on patch set 2 CR +1 03/07/23, 15:44

    AbstractDomainObject.php:156 Reply

    Done

    AbstractDomainObject.php:179 Reply

    Done

    AbstractDomainObject.php:253 Reply

    Done

    DomainObjectInterface.php:58 Reply

    Done

    ObjectMonitoringInterface.php:32 Reply

    Done

    ObjectMonitoringInterface.php:37 Reply

    Done

    ObjectStorage.php:335 Reply

    Done

    ObjectStorage.php:343 Reply

    Done
  12. Alexander Schnitzler rebased onto patch set 3 CR +1 03/07/23, 15:44

  13. core-ci voted on patch set 3 V +1 03/07/23, 15:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38612

  14. Oliver Klee voted on patch set 3 V +1 CR +1 03/07/23, 15:58

  15. core-ci voted on patch set 2 V -1 03/07/23, 16:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38611

  16. Benni Mack voted on patch set 3 V +2 CR +2 03/07/23, 17:25

  17. Benni Mack merged patch set 4 03/07/23, 17:25