Communication between two encapsulated components
<p>I've got three components- a rendering system, a physics simulation, and a UI. The UI code is written in script and is untrusted. Now I need to communicate the results of my physics simulation to the rendering system and am unsure of the correct design. For example, I could simply copy the new sim data over to the renderer every tick. However, this seems like a bit of a waste. I could set the renderer to operate over the sim's data directly, but this seems like it would violate encapsulation.</p>

<p>I am intending this system to work with potentially thousands of moving units, so it is worth keeping performance in mind.</p>

<p>How can I move data from one component to the other quickly without violating encapsulation?</p>
