From processor to editor

Your processor should not know about the editor, and shouldn’t call any functions in it. You also need to assume that there could be zero, one, or many editors attached to the processor, and that this could change at any time, so the links should always be in the other direction. The best approach is either to make an editor periodically check its processor to see if anything has changed, or to have a listener/broadcaster system that allows the editors to register themselves with the processor for callbacks about something - but be very very careful about thread-safety if you do that.

2 Likes