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

[OPTIONAL] Add support to log warnings about the use of certain Annotations (e.g. @Indexed) in the absence of the enabling Annotation (e.g. @EnableIndexing). #7

Open
jxblum opened this issue Jun 1, 2018 · 1 comment

Comments

@jxblum
Copy link
Contributor

jxblum commented Jun 1, 2018

While this is rather difficult to achieve in practice, it may be worth exploring the possibilities.

One of the challenges in properly detecting the use of certain annotations (e.g. @Indexed) on application domain objects without the associated "enabling" annotation (e.g. @EnableIndexing) is that, by way of example, the application domain model objects containing @Indexed annotations are not even picked up unless the @EnableIndexing annotation is present since that triggers a "scan", which is necessary to 1) limit the scope of the application object types introspected as well as 2) detect whether any @Indexed annotations have been declared. Without the scan, the objects containing the annotations are not even inspected in the first place, so how would the infrastructure know the @Indexed annotation was used without @EnableIndexing, for instance. The "enabling" annotation is needed to begin the scan for the object-level annotations, like @Indexed.

@jxblum jxblum changed the title Add support to log warnings about the use of certain annotations (e.g. @Indexed) in the absence of the enabling Annotation (e.g. @EnableIndexing). Add support to log warnings about the use of certain Annotations (e.g. @Indexed) in the absence of the enabling Annotation (e.g. @EnableIndexing). Aug 21, 2019
@jxblum
Copy link
Contributor Author

jxblum commented Feb 24, 2022

Of course, if users want to incur the penalty, infrastructure components could be added in SBDG to necessarily scan all the application class types. This might be useful at development time in order to ensure proper behavior of the application at runtime, in production, such as, "we indexed one or more application domain model object(s) properties with @Indexed and we want to make sure our Spring configuration enabled indexing with the @EnableIndexing annotation."

Additional configuration properties used by the supporting infrastructure components could be defined so that the scan could be further limited.

Still, the use of such a feature should be carefully considered since there would be both a 1) resource (memory) penalty in addition to 2) a startup time penalty.

At any rate, further and careful consideration for such a feature in SBDG is needed.

@jxblum jxblum changed the title Add support to log warnings about the use of certain Annotations (e.g. @Indexed) in the absence of the enabling Annotation (e.g. @EnableIndexing). [OPTIONAL] Add support to log warnings about the use of certain Annotations (e.g. @Indexed) in the absence of the enabling Annotation (e.g. @EnableIndexing). Aug 5, 2023
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

1 participant