EntityNG is now pretty much settled on naming:
- "field": the value objects found in an entity (e.g the value of node 12's 'body')
--> Drupal\Core\Entity\Field\Type\Field (+ Fieldnterface) and Drupal\Core\Entity\Field\FieldItemBase (+ FieldItemInterface)
- "field definition": the metadata about those fields (e.g the definition of 'body' on article nodes)
--> #1950632: Create a FieldDefinitionInterface, decoupled from $field and $instance config entities, and use it for formatters and widgets is about to introduce Drupal\Core\Entity\Field\FieldDefinitionInterface
Just like "fields" are both configurable ("Field API") fields and base fields, the FieldDefinitionInterface will unify the metadata formats for those two kinds of fields.
OTOH, what the "historic" Field API called "field" is the "field definition". In D8:
- the 'field_entity' entity type, and Drupal\field\Plugin\Core\Entity\Field (+ FieldInterface)
- the 'field_instance' entity type, and Drupal\field\Plugin\Core\Entity\FieldInstance (+ FieldInstanceInterface)
- the two being ConfigEntities, field.field.[field_name] / field.instance.[entity_type].[bundle].[field_name] in CMI
So we have:
- Field (entity ng): the values
implements FieldInterface
- Field (field api): the definition of a "configurable field"
implements FieldDefintionInterface
- FieldInstance (field api): the definition of a "configurable field" attached to a specific entity bundle
implements FieldDefintionInterface
(note, we have two more "Field" classes in core:
- the one for "static access to services provided by field.module", similar to the \Drupal class - could be renamed FieldAPI, maybe
- one in Views)
Remember that "terminology" slide in the "old & new Field API" prez in Portland ? :-)
It bugs me a lot, but can't really see another way than to rename Field API config entity classes...
But to what ? with which entity type names and CMI prefixes ?
There is a definite risk of those various things getting excruciatingly long...
Here's a proposal that tries to limit name length where I feel there is less ambiguity:
- ConfigFieldDefinition / ConfigFieldDefinitionInterface
entity type: config_field
CMI: field.field.[field_name] (unchanged)
- ConfigFieldInstanceDefinition / ConfigFieldInstanceDefinition
entity type: config_field_instance
CMI: field.instance.[entity_type].[bundle].[field_name] (unchanged)
Renaming classes / interfaces should be relatively painless.
Renaming entity types shouldn't be too hard thoretically, except we're in the middle of #1953410: [Meta] Remove field_create_*(), field_update_*() and field_delete_*() in favor of just using the ConfigEntity API ;-/
Renaming CMI files - not sure, possibly not that hard...
Thoughts ?