Hey, Some important implications I forgot to mention:
* No more global state is used * No more semi-dependency from DataModel on lib * getPrefixedId is no longer evil and thus not deprecated any more * EntityId and derivatives no longer expose the id format. A FooIdDerivative that has a md5 in it can be created if that'd make sense * One can type hint against ItemId or PropertyId, which are guaranteed to be valid ids for the correct entity type To help understand the usage changes, here are 2 examples: 1. When constructing an id programmatically: Old way: $itemId = new EntityId( 'item', 42 ); New way: $itemId = new ItemId( 'q42' ); 2. When deserializing an item id (for instance in an API module): Old way: $idParser = getParserSomehow(); $itemId = $idParser->parse( $serialization ); New way: $itemId = new ItemId( $serialization ); (Error handling omitted for readability, as its the same in both cases anyway.) Cheers -- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
_______________________________________________ Wikidata-tech mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
