Alibaba cloud Q & A 2022-02-13 07:55:40 阅读数:368
Dubbo Dynamic agent pattern in design pattern , What is it? ？
Dubbo Expand JDK SPI Class ExtensionLoader Of Adaptive Implementation is a typical dynamic agent implementation .Dubbo Need to control implementation classes flexibly , That is, in the call phase, which implementation class to call is dynamically determined according to the parameters , So we use the method of agent class , Be able to make flexible calls . The code to generate the proxy class is ExtensionLoader Of createAdaptiveExtensionClassCode Method . The main logic of the proxy class is , obtain URL The value of the parameter specified in the parameter is used to get the implementation class key.
copyright：author[Alibaba cloud Q & A]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130755386139.html