Split from #2002134: Move TypedData metadata introspection from data objects to definition objects :

DataDefinition::$definition is puzzling:
In most places Object::$definition is "the definition of the object", so here it feels like "the definition of the definition", which makes terrifying recursive mental knots :-p

This results in code like:

class ListDataDefinition { 
  public function __construct(array $definition = array(), DataDefinitionInterface $item_definition = NULL) {
    $this->definition = $definition;
    $this->itemDefinition = $item_definition;
}

$definition as array / $item_definition as DataDefinitionInterface is confusing.

We should try to find a better name for the "variable holding the internal values of a DataDefinition object".

Comments

yched’s picture

Issue summary: View changes
fago’s picture

Status: Active » Closed (duplicate)

#2002134: Move TypedData metadata introspection from data objects to definition objects already goes with $values there, thus closing. Please re-open if you don't think this is a good name.

yched’s picture

I think $values is fine - just wondering if the internal property should be renamed accordingly (we still have $this->definition as array and $this->itemDefinition as Definition)