Skip to content
Permalink
Browse files

Improved: Use ‘depends-on’ attribute instead of “component-load.xml” …

…(OFBIZ-11296)

We currently have two ways to define component loading order. Either
by using ‘depends-on’ attribute in “component-config.xml” or by adding
a “component-load.xml” file at the root of a component directory.

“depends-on” is more flexible because it handles partial ordering when
“component-load.xml” defines a total order which is not necessarily
meaningful, so it is better to rely only “depends-on”.

This removes the usage of “component-load.xml” to use ‘depends-on’
instead. The dependency declarations correspond to the total ordering
previously defined but will need to be refined in the future to relax
unnecessary dependency declarations.

Only “framework/base/config/component-load.xml” which defines the
top-level directories order (framework, applications, themes and
plugins) is kept.
  • Loading branch information
mthl committed Nov 25, 2019
1 parent 0003252 commit eeabe69813a1d9f42911dec70a912574046ef49b
@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="accounting"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="manufacturing"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,9 @@ under the License.
<ofbiz-component name="commonext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<!-- Common component used by most other components must be last because it
uses info from most other "application" components. -->
<depends-on component-name="marketing"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

This file was deleted.

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="content"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="securityext"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="humanres"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="accounting"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="manufacturing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="product"/>
<resource-loader name="main" type="component"/>

<!-- place the config directory on the classpath to access configuration files -->
@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="marketing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="order"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="order"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="humanres"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="party"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="datamodel"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="product"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="workeffort"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="securityext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="party"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="workeffort"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="content"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="catalina"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="service"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>
<entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="common"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="minilang"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

This file was deleted.

@@ -21,5 +21,6 @@ under the License.
<ofbiz-component name="datafile"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="security"/>
<resource-loader name="main" type="component"/>
</ofbiz-component>
@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="entity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="base"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="entityext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="catalina"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="minilang"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="datafile"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="entity"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="service"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="common"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -22,6 +22,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<!-- define resource loaders; most common is to use the component resource loader -->
<depends-on component-name="widget"/>
<resource-loader name="main" type="component"/>

<!-- service resources: model(s), eca(s) and group definitions -->
@@ -21,7 +21,7 @@ under the License.
<ofbiz-component name="webapp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">

<depends-on component-name="entityext"/>
<resource-loader name="main" type="component"/>

<classpath type="dir" location="config"/>
@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="webtools"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="testtools"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

@@ -21,6 +21,7 @@ under the License.
<ofbiz-component name="widget"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
<depends-on component-name="webapp"/>
<resource-loader name="main" type="component"/>
<classpath type="dir" location="config"/>

0 comments on commit eeabe69

Please sign in to comment.
You can’t perform that action at this time.