Bene added a comment.
In https://phabricator.wikimedia.org/T127191#2039646, @adrianheine wrote: > From my point of view, `WikibaseView` is a component providing widgets for a specific set of `WikibaseDataModel` concepts. Since the widgets for items and properties use all other widgets, we provide an `EntityViewFactory` wiring them together. `Wikibase\View\EntityViewFactory` could look like the following for all I (aka `WikibaseView`) care about: > > EntityViewFactory > __construct() > newItemView( ...allTheServicesAndValues ): ItemView > newPropertyView( ...allTheServicesAndValues ): PropertyView > I'd also add factory methods for the `StatementSectionsView` and `EntityTermsView` because extensions of Wikibase defining new entity types want to reuse those views. > Also, `WikibaseView` should define an `EntityView` interface: > > EntityView > getTitleHtml( Entity ): HtmlString > getHtml( Entity ): HtmlString > getPlaceholders(): mixed[] This is almost what `EntityView` currently does. We can however refactor this and define a new public interface of `EntityView` which doesn't contain the protected abstract functions for main and side HTML. > With that, `WikibaseView` seems done to me. > > `WikibaseRepo` (namely `EntityParserOutputGenerator`) on the other hand needs something where it can just put in an entity type and a few other things and get a view. That factory thing should be defined in `WikibaseRepo`, instantiated in `WikibaseRepo.php` based on config, and passed to `EntityParserOutputGenerator`. It would use `Wikibase\View\EntityViewFactory`. I agree on that. TASK DETAIL https://phabricator.wikimedia.org/T127191 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Bene Cc: Bene, adrianheine, gerritbot, Aklapper, StudiesWorld, Izno, Wikidata-bugs, aude, Mbch331 _______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
