Best practice for passing configuration to each GUI object

Posted by Laimoncijus on Stack Overflow See other posts from Stack Overflow or by Laimoncijus
Published on 2010-03-16T22:40:35Z Indexed on 2010/03/16 22:51 UTC
Read the original article Hit count: 193

Hi,

I am writing an application, where I do have few different windows implemented, where each window is a separate class. Now I need somehow to pass a single configuration object to all of them. My GUI is designed in way, where I have one main window, which may create some child windows of its own, and these child windows can have their own childs (so there is no possibility to create all windows in initialization part and feed the config object to all of them from the very beginning)...

What would be best practice for sharing this configuration object between them? Always passing via constructor or maybe making it somewhere as final public static and let each window object to access it when needed?

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about design-patterns