Hi everyone,
I was playing around with https://bugzilla.wikimedia.org/show_bug.cgi?id=46217 ( Implement a special page to show items with the most sitelinks) and I noticed these kind of statistics pages are implemented quite differently. Take for example in https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=tree;f=includes... . If you look for the "most" special pages you'll have getQueryInfo() for the query and formatResult() to format the rows. That seems to be pretty consistent.
At the moment we seem to have two statistics special pages: * https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Wikibase.git;a=... * https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Wikibase.git;a=...
Both seem to be structured quite differently than the normal special pages. Wouldn't it be better to structure https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Wikibase.git;a=... more like https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes... or maybe even extend it?
Maarten
Hey,
SpecialWikibaseQueryPage is abusing inheritance badly and is violating the SRP. It has been identified as one of the more problematic pieces of code in Wikibase. QueryPage itself also violates the SRP rather clearly. Query construction and output formatting belong to different actors. Plus if one derives from it, you'll again have inheritance for code reuse. And that is keeping quit about the problems all special pages have since the special page system is badly designed.
Unfortunately we currently have to deal with this legacy API, and thus have to create a special page. Creating a direct derivative from SpecialPage itself that just delegates to objects of which we can control the lifecycle is one way to minimize dependencies on this legacy API and to mitigate the problems it creates.
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. --
wikidata-tech@lists.wikimedia.org