以下はSpringMVCの例。urlMappingを定数として定義しているため、見てすぐ分からない。
eclipseでホバーすれば分かることは分かるが。
例は単純だが、これにpathValuableとか入ってくると辛い。
執拗に定数定義することは、DBの過度な正規化に似ている気がする。
@RequestMapping(URLMappings.LIST)
public String list() {
...
}
-------
public class URLMappings {
public static final String LIST = "/list";
}