I was looking through the source to SensorManager in Android and found that when you register a SensorEventListener
the SensorManager
passes control of the listener to a ListenerDelegate
.
I only bring this up as an example. I read the Wikipedia article on delegate programming but I am still not sure of its purpose. Why would one use a 'delegate'? How does it help the control flow of a program? What are the disadvantages of using (or not) one? Is it most practical for use with listeners?
Edit: ListenerDelegate
is on line 487 and the methods in question are around line 1054.