daniel added a comment. Regarding mutability: most of our data model objects are mutable. The idea is that we want to be able to build or modify domain objects simply and efficiently. For the same reason, the semantics for mutable objects returned from getters should always be that any changes to that object will be reflected in the "parent object".
The "mutable copy" semantics is something I would generally like to avoid. It's inefficient and confusing. Either our model objects are mutable, or they aren't. I see no use case for modifying a term list or sitelinks list or whatever in which we would not want that change to be reflected in the entity. Well, ok, maybe for filtering during output, though that can also be done on the fly. But if we want a copy, we should explicitly create a copy, not rely on the getter to always implicitly provide a copy, even if none is needed because no modifications are done. TASK DETAIL https://phabricator.wikimedia.org/T126152 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: daniel Cc: daniel, JeroenDeDauw, thiemowmde, Aklapper, Bene, StudiesWorld, Izno, Wikidata-bugs, aude, Mbch331 _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
