Skip to content

component: add ordering support #57

Description

@burakkoken

What problem would this feature solve?

Some framework components need to be processed in a deterministic order.

For example, lifecycle processors, endpoint configurers, event listeners, or other extension components may need to run before or after others. Currently, component ordering is not represented as part of the component model.

What would you like to see?

Add ordering support for components, similar to Spring’s Ordered contract.

Components should be able to expose an order value by implementing an interface:

type Ordered interface {
    Order() int
}

Lower order values should have higher priority and be processed earlier.

When multiple components of the same extension type are resolved, the container or processor should sort them by order before invoking them.

What alternatives have you considered?

Using registration order, but that can be implicit and fragile.

Adding dedicated ordering options for each extension point, but that would duplicate ordering logic across different component types.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions