Use IOC in JBPM3

xiaoxiao2021-03-06  41

In JBPM3, the function of constructing a new object from the configuration file is implemented using reflection. The method is as follows: string configuration = " Hello " "i want yoghurt" "I want yoghurt" "" "" "" "" "" " " " Hello "; mix mix = (mix) beanStantiator.instantiate (Mix.class , configuration; "Hello", Mix.s); Its implementation method is simple, is to use java.lang.reflect. * packet, constructor, and then assign values ​​based on the attribute of the parsed file

In fact, we can achieve its own IOC: Mix Mix = (MIX) Myioc.getBean ("THEMIX"); and Mix Mix = (MIX) BeanStantantiator.class, Configuration ); Comparison, it seems simpler, huh, huh.

转载请注明原文地址:https://www.9cbs.com/read-55675.html

New Post(0)