I am trying to understand how I can make classes reusable. This image illustrates my understaning of it, is this correct?
Here is a text description if you prefer textual information:
I want to only use events to communicate between classes, so Class A that I write for some random app works with Class B written by someone who knows nothing of Class A. Each has their own events that get fired, yet neither have built in listeners. I was thinking that the listeners are created by a “main” application specific to one project that simply brings together all of the reusable classes. This main app adds the listeners to the instances of each class.
Is this how it should work? If not then how do I have classes that communicate using events and listeners but that are not “custom fitted” to each other.
Thanks for any help.