sender calls
it via static methods. Receivers register themselves at initialization
to the configurator. Configurator knows which receiver to select. Sender has no source-code dependency. SENDER RECEIVER 1 RECEIVER 2 RECEIVER3 RECEIVER
CONTRACT CONFIGURATOR CONFIGURATOR CONFIGURATOR the new approach publisher Sender asks the configurator which receiver
to use, like in dependency lookup. Sender contains a hard-coded reference to
the configurator. We avoid hard-coding the names of classes
on which we depend in our code. Sender has a source-code dependency on
the configurator. SENDER RECEIVER 1 RECEIVER 2 RECEIVER3 RECEIVER
CONTRACT CONFIGURATOR CONFIGURATOR CONFIGURATOR B application
context spring SENDER RECEIVER 1 RECEIVER 2 RECEIVER3 sender’s provided interface sender’s required interface RECEIVER
CONTRACT CONFIGURATOR Configurator tells the sender what receiver
to use, like in dependency injection. Receiver is held in sender in a local variable. It is set the receiver during execution, or
at initialization. Sender still has a source-code dependency
on the receiver. A spring