1. The Singleton mode is used.
I think this is the most basic, generalProgramThe parser is used in this way. It should be noted that agileflow
In addition to the singleton mode, the configuration file is dynamically loaded. If you modify the configuration file
Dynamically obtain these changes during running.
When using jbpm, use this mode In the first sentence: jbpmservicefactory. getinstance ()....
2. Both the default configuration and custom configuration are implemented.
In shark, the default configuration is placed in a deep directory, and the custom configuration is placed in the config directory.
The file content is similar;
In jbpm, the default configuration is placed inCodeIs as follows:
Propertyclassnames = new hashmap ();
Propertyclassnames. Put ("default", "org. jbpm. impl. defaultservicefactory ");
Abbreviatedclassnames. Put ("jbpm. Service. Factory", propertyclassnames );
The custom configuration is placed in the config Directory, which is jbpm. Properties
In comparison, jbpm is better implemented for the following reasons:
1) The default configuration is easy to find
2) custom configuration is very simple. By default, there is no configuration, which is much clearer than shark.
3. all implement the use of one Singleton to implement multiple Singleton
I have discussed this function in the Article of the shark Learning Series, jbpm is in jbpmconfiguration. implemented in Java:
private void instantiateconfiguredobjects () {
// instantiate configured objects
This. filemgr = (filemgr) instantiate ("jbpm. file. mgr ", filemgr. class);
This. idgenerator = (idgenerator) instantiate ("jbpm. id. generator ", idgenerator. class);
This. servicefactory = (servicefactory) instantiate ("jbpm. service. factory ", servicefactory. class);
}