Should mapping value be declared in a constant or as an enum?

Viewed 11189

I see this scattered throughout code base:

@RequestMapping(value = "myValue")

I would prefer to use something like this:

@RequestMapping(value = Constants.myValue)

It seems to break DRY using the actual String value within @RequestMapping instead of constant. But is this good code practice? Should I use an enum instead? I may need to use Constants.myValue elsewhere in the code base.

1 Answers
Related