Java annotations for design patterns?
Posted
by Greg Mattes
on Stack Overflow
See other posts from Stack Overflow
or by Greg Mattes
Published on 2008-09-24T14:15:30Z
Indexed on
2010/04/08
21:03 UTC
Read the original article
Hit count: 381
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
© Stack Overflow or respective owner