Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProcessBeanAttributes order #666

Closed
jeanouii opened this issue Apr 25, 2023 · 3 comments
Closed

ProcessBeanAttributes order #666

jeanouii opened this issue Apr 25, 2023 · 3 comments

Comments

@jeanouii
Copy link

Currently, the order defined is PIP -> PIT -> PBA -> PB (or PP).
Anyways, considering the impact of mutating Bean attributes using the PBA event, wouldn't it be better to have the PBA triggered first and before PIP/PIT?

@manovotn
Copy link
Contributor

I don't think that's good idea and below are just a few thoughts from the top of my head as to why:

  • PBA allows you to change things such as types, qualifiers, stereotypes, name and alternative flag.
    None of the above is linked to PIT or PIP so I am not sure I see what would be the benefit of altering beans via PBA first and then doing the other events?
  • While bootstrapping, CDI [Full] first works with AnnotatedType which it later converts into Bean; PIT still operates on AnnotatedType (PIT#getAnnotatedType()) while PBA is already a point at which you move onto Bean. Swapping them around would break this logical procedure.
  • Having PIP and PIT before PBA actually has a use case - you are able to monitor the injection target and injection points of a given bean and after you have that information, you can still decide to either change or veto the bean.

Last but not least, this sequence is well defined (in terms of not being ambiguous) in the spec and changing it would be backwards incompatible. That's of course doable but while I can imagine cases which it breaks and that won't work afterwards (see my third point above), I don't really see what's the gain in it. Maybe I am just missing something?

@jeanouii
Copy link
Author

Thanks Martej.

That helps. I had a simpler view in mind and of course, you are correct. The second bullet is really a key point to me which makes the PBA coming after more relevant.

Sorry if it looked stupid.

@manovotn
Copy link
Contributor

Agreed with @jeanouii on the CDI mtg that we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants