Lucas_Werkmeister_WMDE added a comment. |
Okay, after discussion with Thiemo, the new implementation plan is:
- Add a CachingMetadata value object that holds the max-age and possibly additional information in the future. It also has a static constructor to merge several CachingMetadata objects into a new one.
- Add a CachedBoolean class and a CachedArray class which wrap a value and some CachingMetadata. Make the helpers return those.
- A CheckResult can optionally hold a single CachingMetadata object, with a simple getter/setter interface.
And here’s how I would split that up across commits:
- add CachingMetadata + test (and we might as well start with a max-age right away, no need to keep that in a separate change)
- add CachedArray, subclass CachedQueryResults, use in runQuery()
- add CachedBoolean, use in SparqlHelper+TypeCheckerHelper
- add CachingMetadata to CheckResult and API response
- question: should the CachingMetadata know how to serialize itself to an array for the API response, or does this logic live in the API?
- add ancillary message to gadget (not sure if this commit even needs any changes apart from a rebase… but I suppose yes, if we want to include the unit “seconds” in the max-age field name)
TASK DETAIL
EMAIL PREFERENCES
To: Lucas_Werkmeister_WMDE
Cc: gerritbot, Aklapper, Lucas_Werkmeister_WMDE, Lahi, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Lewizho99, Maathavan, Agabi10, Wikidata-bugs, aude, Mbch331
Cc: gerritbot, Aklapper, Lucas_Werkmeister_WMDE, Lahi, Lordiis, GoranSMilovanovic, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, QZanden, Lewizho99, Maathavan, Agabi10, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs