I often find myself in situations where objects need to communicate between each other. For example, a button might need to talk to various textboxes. Would it be proper to simply construct each widget with a pointer to the container for all of them? Would it be better to give it a pointer to a resource container map where the object can locate another object by string or something? This area has always been very vague to me. I could easily implement everything I want to do if I just constructed objects with pointers to containers of every other object, but that seems wrong. In the case of a widget, would it actually just be more proper if the widget knew nothing about the outside world and instead its action listeners were constructed with resource access?ThanksI understand that it is a bad idea but what are some solutions in these situations eg: good design patterns for gui oriented software? If a button's click needs to write a file, how can that be done in a clean way? Action Listeners? But where do they get created and by what?
Is it acceptable practice to give an object a pointer to the world?
programming languages;c++;object oriented