Replies: 1 comment
-
Безусловно умный, но тестовый комментарий для демонстрации оповещений в Slack. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
На данный момент действует конвенция, согласно которой принято создавать WidgetModel непосредственно при инициализации класса виджета. В супер-конструктор WM передается так называемый WidgetModelBuilder, который производит экземпляр WidgetModel. На этом этапе осуществляется поставка в WidgetModel необходимые зависимости.
Такой механизм служит препятствием для тестирования виджета в изоляции, так как для этого требуется подменять зависимости WidgetModel на моковые. Этой возможности при текущем подходе мы лишены.
Очевидным, но некрасивым решением, является вынос создания WidgetModel из виджета на уровень описания дерева виджетов. Минус в том, что мы получим смешение DI и UI.
Предлагаю подумать, существуют ли более приемлемые решения.
Beta Was this translation helpful? Give feedback.
All reactions