I was looking through the source to SensorManager in Android and found that when you register a SensorEventListener
the SensorManager
passes contro
Delegation is not exactly a 'design pattern' in the sense used in the GoF book. It is useful in a number of scenarios, and is a base for other patterns
Collections.synchronizedList(..)
creates a new collection that delegates to the original one, but has its methods synchronized.EnumerationIterator
class, that adapts enumerations to the Iterator
interface. The class has a hasNext()
method which delegates to enumeration.hasMoreElements()
Car
can have start()
, openWindow()
and brake()
, but each of these methods will actually delegate to the engine, el.windows and braking system (see also this)