daniel added a comment. Summary of some a brief discussion with Adrian and Jan:
With the Role Object approach, consumers of extra data cannot declare that they want to use that data. With lookup/mapping services, consumers can declare the dependency by requiring the respective services to be injected. This disadvantage of the Role Object approach is mitigated somewhat by the fact that the extra data is usually considered optional (even if retrieved via a lookup service). This however does not answer the question how calling code should know when which extra roles need to be injected into the model. When a model is built from an API response, all the desired extra data would be in the JSON, and then also in the model, as role objects. However, if the original model is deserialized from the database representation that lacks any extra info, we need to somehow know which additional data should be inserted before passing the data model to e.g. a formatter/view component for rendering to HTML. TASK DETAIL https://phabricator.wikimedia.org/T118860 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: daniel Cc: Bene, Lydia_Pintscher, mkroetzsch, adrianheine, hoo, thiemowmde, aude, Jonas, JanZerebecki, JeroenDeDauw, Aklapper, StudiesWorld, daniel, Wikidata-bugs, Mbch331 _______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs