A senior architect in my team is writing his new queries with pre-made constants. Other than the benefit of avoiding repetition, all I see is over engineering and making things hard to read/debug/code-review etc. We have some large and complex queries which has been converted just like this, which makes it a nightmare to look at. What other benefits do you see here?
Sample Code:
final String sql = DELETE.toString()
+ FROM
+ SCHEMA_NAME
+ DOT
+ TABLE_NAME
+ WHERE_CLAUSE
+ FK_SALES_ORDER_DISCOUNT_COLUMN_NAME
+ EQUAL_SIGN
+ QUESTION_MARK
+ AND
+ THRESHOLD_COLUMN_NAME
+ SqlOperator.NOT_ALL
+ LEFT_PARENTHESIS
+ QUESTION_MARK
+ RIGHT_PARENTHESIS;
10