Skip to content

gui: Make gui-view-model independent of common

Context

common types are always fine but GUI has specific needs (observability, difference in mutability, favours String types). Having the two kinds of types accessible is confusing because one does not know whether to use the common type or a specific gui-view-model type.

So to simplify, don't expose transitively common types from gui-view-model. Actually, don't even use it in its implementation: Instead, make gui-controller and gui-presenter performs the necessary conversions, acting as an anti-corruption layer.

See also this interesting blog post and the associated video. Related to #39 (closed). Closes this comment on the main MR.

What has changed?

Main Changes

common

  • Removed types and methods only used by GUI.

gui-view-model

  • Added GridCoord types (sibling of common's GridPosition)
  • Moved DictionaryKey from common
  • Explicitly removed dependency to common from module-info and build.gradle

gui-controller, gui-presenter

  • Convert types from gui-view-model to common and vice-versa

gui-view

  • Adjustements to use new gui-view-model types

Merge request reports