# Add a priority concept to components

**URL:** <https://forum.xwiki.org/t/add-a-priority-concept-to-components/10926>\
**Category:** Development\
**Tags:** brainstorming\
**Created:** [August 30, 2022, 3:10pm UTC](https://forum.xwiki.org/t/add-a-priority-concept-to-components/10926 "2022-08-30T15:10:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [August 30, 2022, 3:36pm UTC](https://forum.xwiki.org/t/add-a-priority-concept-to-components/10926/2 "2022-08-30T15:36:06Z")

</div>

You don’t mention what your proposal means for ComponentDescriptor, but that’s what everything is based on.

> [@surli](#):
>
> This priority would have different usages

For me, this does not really make sense.

There should be two completely different values since it’s two completely different use cases and needs and I can easily think of use cases where you need to override a specific component and at the same time order it among others components which share the same role and there is very little chance that you can use the same value for both (just think of a use case where you override a component to change its order).

If you really want to talk about both subjects in the same proposal, I would suggest the following changes:

- `ComponentDescriptor` should have two different getters for those concepts (“override priority” and “role priority”)
- As you proposed, having the “role priority” as a field of the `@Component` annotation sounds good
- Keeping `components.txt` as the way to configure the “override priority” for Java components is probably enough, I’m fine having the possibility to also configure it at `@Component` level as long as it’s a different field
- For wiki based components, all it takes is adding two properties for those concepts in whatever xclass which is used to define them

---

_[View the full topic](https://forum.xwiki.org/t/add-a-priority-concept-to-components/10926)._
