I have a GUI with nested panels(tabbed with nested panels and etc). I need to pass domain object to deeply nested panel. I can think of two ways:
Instantiate all gui objects in one place, like frame class. That would make passing domain objects dead simple, but Frame class will be huge and hardly maintanable.
Each panel has its own class, where we instantiate and layout its
components. Now its easy to maintain and classes are clean, but how
do I pass down the chain my domain objects? I dont want to chain-pass them through constructors of panels that shouldn't even know their
existance. And top level panels would have a ton of these objects to start with.
Niether way seems like a soulution. How do you usually aproach this?