HomePhabricator

Use ViewFactory for building children of entityviews

Authored by adrianheine.

Description

Use ViewFactory for building children of entityviews

This change introduces ViewFactory methods for creating entitytermsview,
sitelinkgrouplistview and statementgrouplistview widgets. These methods are
passed to the different entityviews so that they can create the widgets
without having to pass them all their dependencies.

It improves separation between the entityviews and their immediate children,
since the entityviews don't have to know how to construct the child views.
It also allows to inject different implementations, for example in tests.

In more expressive type systems, this would have been implemented by having
three single-method interfaces (EntityTermsViewFactory,
SitelinkGroupListViewFactory, StatementGroupListViewFactory) and having
the ViewFactory implementing all three of them.

This is a first step for T75380.

Change-Id: I996c57f6fd6a1c6a4575bb82cbcbb7726eca4328

Details

Committed
adrianheineSep 30 2015, 12:41 PM
Parents
rEWBA67badbf55cb5: Remove unused feature from labelview
Branches
Unknown
Tags
Unknown
ChangeId
I996c57f6fd6a1c6a4575bb82cbcbb7726eca4328