jayasuryat/dowel

Add AnnotationTarget.ANNOTATION_CLASS target

Opened this issue · 3 comments

If the support for AnnotationTarget.ANNOTATION_CLASS is added to @Dowel targets, it would be possible to define a tailored annotation like the following:

@Dowel(
    count = 2,
)
annotation class MyAnnotation

Hey, @mohsen-biglari!
Thank you for raising this request.


I want to understand your requirement a little deeper.
@Dowel annotation only offers one single configurable value (count). Creating a tailored annotation for configuring one single value seems a little unnecessary, isn't it?

What exactly is the benefit that you see is gonna come out of this?
Please shed some light on how this might improve you DevEx, thank you.

My requirement at the time was being able to change the default value of count globally. I also can see the number of configurable parameters growing. It will also enable combining Dowel with other related annotations.

I see.


Instead of the @Dowel annotation pulling the double duty, I see adding a new annotation to facilitate this would separate the concerns a little nicely and will avoid confusion, both at the library level and consumer level.

But this would be a significantly big change, I can't promise anything right now.

But this issue is on my radar. I'll evaluate if this fits into the bigger picture, and what's the feasibility of doing this. And will get to it whenever I get a chance next.


My requirement at the time was being able to change the default value of count globally.

Meanwhile, to address this, you could probably use a top level const val to store the count and use that value everywhere as the @Dowel annotation parameter. If that works for you.