in Education by
Is there a project that maintains annotations for patterns? For example, when I write a builder, I want to mark it with @Builder. Annotating in this way immediately provides a clear idea of what the code implements. Also, the Javadoc of the @Builder annotation can reference explanations of the builder pattern. Furthermore, navigating from the Javadoc of a builder implementation to @Builder Javadoc is made easy by annotating @Builder with @Documented. I've being slowing accumulating a small set of such annotations for patterns and idioms that I have in my code, but I'd like to leverage a more complete existing project if it exists. If there is no such project, maybe I can share what I have by spinning it off to a separate pattern/idiom annotation project. Update: I've created the Pattern Notes project in response to this discussion. Contributions welcome! Here is @Builder JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
This seems like a misuse of annotations to me. Sure, I could see why you might want to note what design pattern a class is helping to implement, but just using the Javadoc and/or the name of the class seems more appropriate. The name of the pattern that you're using is of no actual importance to the code itself... patterns are just a guide for an often used way of solving a problem. A comment would suffice, rather than creating a new file for every pattern you use.

Related questions

0 votes
    Are you aware of design patterns?...
asked Jun 13, 2021 in Education by Editorial Staff
0 votes
    Name some of the design patterns which are used in JDK library....
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    Name types of Design Patterns?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    What are Design Patterns?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    We have a library where users can pass in dates in multiple formats. They follow the ISO but are ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    What are the callback annotations for entity bean?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What are the callback annotations for message driven bean?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What are the callback annotations for stateful bean?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    What are the callback annotations for stateless bean?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Annotations which are applied to other annotations are called meta annotations. (a) True (b) False The question ... Annotations of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Which one of the following annotations is not used in Hibernate? (a) @Entity (b) @Column (c) @Basic (d) ... & Annotations of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Which one of the following annotations is not used in Hibernate? (a) @Entity (b) @Column (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What are the Basic Annotations that Spring Boot Offers?...
asked Jul 7, 2021 in Technology by JackTerrance
0 votes
    ________ is a type of intelligent technique that finds patterns and relationships in massive data sets too large for a ... to analyze. Select the correct answer from above options...
asked Dec 6, 2021 in Education by JackTerrance
...