DDC-3983: Replace metadata factory with pre-runtime (constructor-injected) metadata map #4865

Closed
opened 2026-01-22 14:50:53 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 7, 2015).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user @ocramius:

ORM metadata is currently "lazy" by default:

  • we inject a metadata driver in the metadata factory
  • the metadata is mutable, which is causing big headaches
  • the mix of metadata drivers and ORM functionality makes functional tests around mapping

Instead, we can:

  • inject the metadata in the ORM entry point ( EntityManager::**construct() or equivalent)
  • make the metadata lazy (if needed)
  • make the metadata a simple Map<ClassName, ClassMetadata>

Doing this allows us to completely externalize the mapping drivers, so that they can be maintained by third parties.

This change requires DCOM-308 to be implemented first, as that is the metadata structure that we want to reach first.

Originally created by @doctrinebot on GitHub (Nov 7, 2015). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user @ocramius: ORM metadata is currently "lazy" by default: - we inject a metadata driver in the metadata factory - the metadata is mutable, which is causing big headaches - the mix of metadata drivers and ORM functionality makes functional tests around mapping Instead, we can: - inject the metadata in the ORM entry point ( `EntityManager::**construct()` or equivalent) - make the metadata lazy (if needed) - make the metadata a simple `Map<ClassName, ClassMetadata>` Doing this allows us to completely externalize the mapping drivers, so that they can be maintained by third parties. This change requires [DCOM-308](http://www.doctrine-project.org/jira/browse/DCOM-308) to be implemented first, as that is the metadata structure that we want to reach first.
admin added the New Feature label 2026-01-22 14:50:53 +01:00
admin closed this issue 2026-01-22 14:50:53 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 7, 2015):

@doctrinebot commented on GitHub (Nov 7, 2015): - depends on [DCOM-308: Create a Mapping Component](http://www.doctrine-project.org/jira/browse/DCOM-308)
Author
Owner

@doctrinebot commented on GitHub (Nov 8, 2015):

Comment created by @beberlei:

How can mapping drivers not be implemented by third parties right now by overriding the Driver interface? I don't see a benefit here.

In applications with 100 entities, loading them all every request is a clear no-go.

@doctrinebot commented on GitHub (Nov 8, 2015): Comment created by @beberlei: How can mapping drivers not be implemented by third parties right now by overriding the Driver interface? I don't see a benefit here. In applications with 100<ins></ins> entities, loading them all every request is a clear no-go.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4865