Issue Task Under Review

#111654Add EntityInterface and ValueObjectInterface and check on them instead of the abstract classes

Alexander Schnitzler 11/29/26, 09:03 updated 11/29/26, 12:45

Description

Current state

Extbase decides what a domain object is by checking for abstract classes:

  • AbstractDomainObject in CleanStateTracker, Backend, PersistenceManager, ExtbaseHistoryTracker and Fluid’s AbstractFormViewHelper
  • AbstractValueObject in Backend::insertObject(), UriBuilder, PersistentObjectConverter, BackendInterface::getUidOfAlreadyPersistedValueObject() and DebuggerUtility
  • AbstractEntity in DebuggerUtility and ClassesConfigurationFactory

A model therefore has to extend one of these classes, although they only carry boilerplate. DomainObjectInterface exists, but it does not tell entities and value objects apart, and the framework does not rely on it consistently.

The distinction matters: a value object is looked up by its property values before it is inserted, it is serialized to an array in URIs when it has no uid, and its __identity is dropped during property mapping.

Goal

  • Add EntityInterface and ValueObjectInterface as signaling interfaces without methods. getUid(), getPid() and setPid() stay on DomainObjectInterface for now.
  • AbstractEntity implements EntityInterface, AbstractValueObject implements ValueObjectInterface.
  • The framework checks on the two interfaces only. The abstract classes stay as optional boilerplate and are no longer asked for.
  • A class implementing both interfaces is rejected when its class schema is built.

Out of scope

  • Methods on the new interfaces
  • Removing DomainObjectInterface and AbstractDomainObject

Reviews 1

History 01

  1. Gerrit Code Review pushed patch set 1 for main to change 98192 status New Under Review 11/29/26, 12:45