ChangeBroadcaster question

Is this dangerous to make your JUCEApplication be a ChangeBroadcaster ?

And thus to addChangeListener in the initialize() function ?

thank you.

…yes, that’s possibly about the most dangerous/confusing way you could use a changebroadcaster.

If you have an object that owns some specific piece of data, you make it a changebroadcaster, so that other objects can register with it to be told when its data changes. You don’t just bolt it on to random classes unless it’s obvious why it’s there, and what the “change” that it signals might be.

And your app object should do almost nothing apart from launch a few other windows and things. It’s just an entry point.

1 Like