Great question!
IMHO, you want to continue to use property files to localize this kind of string - it allows you to use Java IL8N's built-in functions, and it saves you a lot of time.
In general, my recommendation is to store local strings for domain objects in a database β for example, if you have a product database and you need to store product names that are explicitly part of the domain; product managers also need to manage product names, and you want to enforce business logic and referential integrity.
You can argue that this applies to the example you cited - the names are part of the person domain and must be managed in a database.
For user interface elements - the text on the button, the name of the menu element - the properties files are absolutely correct.
If you think the βnameβ is part of the user interface, or you donβt want to move it because you have an established localization process, my recommendation is to sort in Java, not in SQL; Based on how you connect to the database, there are many ways to do this.
source share