Details
-
Improvement
-
Status: Reopened
-
Minor
-
Resolution: Unresolved
-
Trunk, Upcoming Branch
-
None
-
None
Description
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”.
Attachments
Attachments
- OFBIZ-11296_ignore-depends-on-when-a-component-load.xml-is-prese.patch
- 4 kB
- Mathieu Lirzin
- OFBIZ-11296_0001-Improved-Use-depends-on-attribute-instead-of-compone.patch
- 20 kB
- Mathieu Lirzin
Activity
This is an important change which affects the configuration options of the system and therefore has an impact on existing productive installations.
Such a change needs a thorough discussion before it is introduced. it should also be provided as a patch for review of others before it gets committed to the codebase.
mthl I did not find a discussion or review process. In cased I've missed something, , can you please point me to them?
Hello mbrohl
To my knowledge OFBIZ-11296_0001-Improved-Use-depends-on-attribute-instead-of-compone.patch has not much impact because the component-load.xml feature is still available for productive installations in case they want to activate/reorder components using this feature (they simply need to create a file in the directory of their choice). Did you notice a bug?
From my point of view the change did not require a prior discussion, but I might be overlooking some important aspect that make it necessary to have such discussion. Maybe you have something specific in mind ?
Commit aae1c8a8f5fed7de717290c938297be62c0460fa in ofbiz-framework's branch refs/heads/trunk from Mathieu Lirzin
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=aae1c8a ]
Reverted: "Improved: Use ‘depends-on’ attribute instead of “component-load.xml”"
(OFBIZ-11296)
This reverts commit eeabe69813a1d9f42911dec70a912574046ef49b.
The good thing about this feature/improvement is, is that it is going to show in a singular file in each component what the (component-) dependencies are. And thus lowering the bar for contributors to remove undesirable dependencies.
Hello I have included OFBIZ-11296_ignore-depends-on-when-a-component-load.xml-is-prese.patch which fixes the regression where people were not able to add a custom component-load.xml files in a directory without getting "depends-on" attributes ignored. I will commit that fix in 3 days if nobody objects.
Regarding OFBIZ-11296_0001-Improved-Use-depends-on-attribute-instead-of-compone.patch which replaces usages of component-load.xml files in framework/applications directories with depends-on declarations and have been reverted because of the "regression" described above, if mbrohl (or others) does not provides a convincing explanation (which has been asked multiple times) why they consider the ability to mess with framework/applications component-load.xml a feature and not an implementation detail, I will recommit it in 3 days too.
mthl, please consider that people have limited time and that they have to put priorities on how they spent it. Putting pressure on (non bugfixing) issues does not help good collaborations.
Please also refrain to put judgements in your statements like "why they consider to mess with..." or else. Simply trust people who are around for a long time and have deep, real life project experience with OFBiz for a long time (for me it's coming to about 18 years now).
This project is not only about tech, it has a user base with serious business running on base of OFBiz. This has always to be considered as serious as good technical solutions should be considered. So we cannot simply change things because single contributors like other technical solutions better. We have to remain downwards compatible and manage deprecation of features carefully.
Until now, there was not a single thumbs up from experienced contributors for this change, but objections from others. This alone should make you think about your approach.
Me fighting for the right approach also does not necessarily mean that I have (current) personal or customer interests in mind. The user base is much bigger than "my" user base.
If you read carefully what I previously wrote, there are several uses for the applications component-load.xml:
- deactivation of unused component(s) by commenting out the load-component entry (why load marketing resources if you don't use the component at the moment)
- addition of components (yes, I've seen projects where this was not done through the hot-deploy mechanism)
- ordering these components in the right load order
While you can argument that these might be "wrong" approaches, they are technically valid and used in customer projects. Therefore we cannot simply switch the mechanisms without a proper deprecation period.
For the plugins, all the above use cases are common in our projects. We also use a multi-level configuration mechanism (standard default - custom standard default - project default and targeted systems) where we are able to do fine-grained configurations and generate the resulting component-load.xml at build time.
My proposal would be to actively ask other contributors with significant project experience for their input before re-commiting anything.
If there is a demand for your solution, I would also propose to make the solution compatible with the component-load mechanism and leave the old component-load.xml in place, together with a deprecation announcement and proper documentation on how to migrate. This would introduce the new depends-on in the next release but does not change anything for existing users if they want to stick with the component-load mechanism.
For the plugins, I object to introduce the mechanism at all for the above stated reasons.
I hope this explains my point of view clear enough, please ask if it does not.
This explains your point of view more clearly.
As I understand it your points are mainly about general principles regarding how framework evolutions should be handled so I will respond on the mailing list instead of this specific ticket.
Well, actually no. A good half of my last comment is about this specific issue here, giving reasons why to keep the component-load.xml mechanism as requested.
Am I really writing so unclear?
You are right that your anwser is containing points specific to this issue however they are based on general principles (stability for production, backward compatibility, relation to community approval). Those principles are too far from my perspective/requirements as a developer trying to make OFBiz better, that I cannot see a way to resolve this specific issue without discussing the principles first.
I see the following benefits with using depends-on over component-load.xml:
(1) Know which components are non-dependents or redundant, and can be disabled.
(2) Clearer rules so that dependency isn't introduced unwittingly to the java code.
(3) Allow components to be dropped in without configuring the component-load.xml file.
(4) Better approach when we need to manage hundreds of components.
Some questions:
It is unknown how point (1) can be achieved with the removal of component-load.xml, but mbrohl has mentioned component-load.xml being used to enable / disable the components to be loaded.
Another point raised is to control the ordering of components.
Understand there is a “commonext” component which is meant to be loaded last.
So the question here is: should we close as won't do? Because Mathieu somehow explained that it will not continue anymore: https://markmail.org/message/fod6n3nwwdvk4gk7
-1 to closing this ticket.
Michael has stated already several times that he has no objections to have it in play in the framework stack. And IIRC Mathieu has stated that the enhancement does not break the code.
Furthermore, this would be valuable in special purpose plugins and themes (developed not only by contributors, but also by those employed/hired by adopters).
Some pre-Merge test rest results:
+1 overall ____ _ / ___| _ _ ___ ___ ___ ___ ___| | \___ \| | | |/ __/ __/ _ \/ __/ __| | ___) | |_| | (_| (_| __/\__ \__ \_| |____/ \__,_|\___\___\___||___/___(_) | Vote | Subsystem | Runtime | Comment ============================================================================ | 0 | reexec | 0m 51s | Docker mode activated. +--------------------------------------------------------------------------- | | | | Prechecks +--------------------------------------------------------------------------- | +1 | dupname | 0m 0s | No case conflicting files found. | +1 | @author | 0m 0s | The patch does not contain any @author | | | | tags. | -0 | test4tests | 0m 0s | The patch doesn't appear to include any | | | | new or modified tests. Please justify why | | | | no new tests are needed for this patch. | | | | Also please list what manual steps were | | | | performed to verify this patch. +--------------------------------------------------------------------------- | | | | trunk Compile Tests +--------------------------------------------------------------------------- | +1 | compile | 27m 20s | trunk passed | +1 | checkstyle | 16m 12s | trunk passed | +1 | javadoc | 4m 49s | trunk passed +--------------------------------------------------------------------------- | | | | Patch Compile Tests +--------------------------------------------------------------------------- | +1 | compile | 8m 0s | the patch passed | +1 | javac | 8m 0s | the patch passed | +1 | checkstyle | 15m 13s | the patch passed | +1 | whitespace | 0m 0s | The patch has no whitespace issues. | +1 | javadoc | 4m 23s | the patch passed +--------------------------------------------------------------------------- | | | | Other Tests +--------------------------------------------------------------------------- | 0 | asflicense | 0m 57s | ASF License check generated no output? | | | 92m 31s |
Hi Pierre,
Yes, but who will handle this issue? Because, after reverting, from last exchanges it seems to me that Mathieu will not...
Since these are the missing implementation for 'depend-on' function, we can commit the patches but keep the component-load.xml in applications folder. But I haven't test the patches yet.
Commited in eeabe69813a1d9f42911dec70a912574046ef49b