I've extracted the various typed data API improvements out of the comment conversion issue such that it's easier to review them on their own. Original issue: #1778178: Convert comments to the new Entity Field API
Short summary of the improvements:
- The typed data manager now supports prototyping typed data objects via getPropertyInstance(). That's a rather big performance improvement compared to creating the same kind of typed data objects each time. That's used by the entity API.
- For the above improvement to work out the ContextAwareInterface has been improved and now also contains getPropertyPath() - what is inline with the usage of property paths of the symfony validator component.
- This patch changes how the EntityNG BC-compatibility mode works. Instead of having a the compatibility mode as state in the entity object it uses a decorator object. That better separates things and avoids us having to enable/disable compatibility mode each time + should help with further conversion issues as it allows us to do an interim conversion step: Migrate to the new API but do not use EntityNG yet, instead just provide an EntityNG-compatibility object from $entity->getOriginalObject(). Thus meanwhile, the regular entity would be the BC-compatibility one.