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

Add proximity property to AddLifecycleHook #398

Open
jlink opened this issue Oct 25, 2022 · 1 comment
Open

Add proximity property to AddLifecycleHook #398

jlink opened this issue Oct 25, 2022 · 1 comment

Comments

@jlink
Copy link
Collaborator

jlink commented Oct 25, 2022

Testing Problem

Motivated by #395 it would be useful to be able to specify the proximity of Lifecycle hooks not only at implementation time - through overriding the proximity method - but also at specification time. This would for example allow to influence the order in which lifecycle hooks are executed in regard to lifecycle methods (@BeforeProperty etc.)

Suggested Solution

Implement attribute proximity to AddLifecycleHook annotation which will translate the proximity to the hooks proximity.

Discussion

This is not as straightforward as it sounds, because different hooks have different proximities.
E.g. AroundPropertyHook has just aroundPropertyProximity() and AroundContainerHook has three different proximity values. Moreover, a single lifecycle hook implementation can implement more than one lifecycle hook. Therefore, a single attribute like proximity may not suffice.

@adam-waldenberg
Copy link

This is true... Maybe something like a @HookProximity annotation is the way to go in order to set it. If no hook is specified it could, by default set a proximity for all of them.... and if it can be set on both method and on the class it would allow for pretty great control.

It suddenly got a lot more complicated though :)

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

No branches or pull requests

2 participants