thiemowmde added a comment.

  It might be a good idea to expand that ADR then. It appears to be incomplete. 
I miss, for example, an explanation what that mental load is, and how it 
compares to the problems that come with EntityDocument.
  
  If you want you can think of EntityDocument as a migration path away from the 
previous Entity class 
<https://github.com/wmde/WikibaseDataModel/blob/15c79d/src/Entity/Entity.php>. 
It was never meant to solve much other than making it easier to get rid of it 
and focus on what an entity type really is. What's left in the class boils down 
to "something with a getId method". That's it. But we already have a concept 
for that: use EntityId.
  
  I tried to follow a few code paths that currently use EntityDocument. What I 
find in the end is always something like this 
<https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/lib/includes/Store/Sql/Terms/DatabaseMatchingTermsLookup.php$143>.
 This is cheating. This code pretends to forget the entity type – just to send 
it somewhere where the code paths separate again. And sure, it needs to. 
Without knowing the type (or trait, e.g. StatementListProvider) no code could 
do anything meaningful with an EntityDocument alone. But what's even the point 
then?
  
  What we currently have is a codebase where everything is written with certain 
entity types or traits in mind, but the code doesn't say that.
  
  Making more classes implement EntityDocument makes this worse.
  
  Not using EntityDocument means we end with more code that clearly says for 
which entity type it is written. Or even better: code that mentions the traits 
it is interested in, e.g. StatementListProvider, as listed above.

TASK DETAIL
  https://phabricator.wikimedia.org/T344609

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Michael, thiemowmde
Cc: Lydia_Pintscher, thiemowmde, Lucas_Werkmeister_WMDE, hoo, Bugreporter, 
Aklapper, Michael, Danny_Benjafield_WMDE, Isabelladantes1983, Themindcoder, 
Adamm71, Jersione, Hellket777, LisafBia6531, Astuthiodit_1, 786, Biggs657, 
karapayneWMDE, Invadibot, maantietaja, Juan90264, Alter-paule, Beast1978, 
ItamarWMDE, Un1tY, Akuckartz, Hook696, Kent7301, pdehaye, joker88john, 
CucyNoiD, Nandana, Gaboe420, Giuliamocci, Cpaulf30, Lahi, Gq86, Af420, 
Bsandipan, Andrawaag, GoranSMilovanovic, QZanden, YULdigitalpreservation, 
LawExplorer, Salgo60, Lewizho99, Maathavan, _jensen, rosalieper, Neuronton, 
Scott_WUaS, MisterSynergy, abian, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to