It depends on your design intention:
If ApplicationState
ApplicationState
and DimensionDimension
address different concernsdifferent concerns and may evolve due to different reasons, then it is fine.Likewise, if ApplicationState
ApplicationState
is just there for using a DimensionDimension
with another interface/protocol, then it is an adapteradapter and is also fine.If ApplicationState
ApplicationState
is nothing else than a specialized DimensionDimension
, then this might be overkill.
To make up your design decision, you should also be a areaware that a lotlots of appState.dim.dimOperation()appState.dim.dimOperation()
creates a de facto coupling that works well in practice but makes the code difficult to maintain (see also principle of least knowledge).