frank
02/21/2021, 1:55 PM# Method 1:
private const val API_PATH = "<http://localhost:8080>"
const val WELCOME_ENDPOINT = "$API_PATH/welcome"
# Method 2:
object EndPoints {
private const val API_PATH = "<http://localhost:8080>"
const val WELCOME = API_PATH + "/welcome"
}
Vampire
02/21/2021, 2:30 PMYoussef Shoaib [MOD]
02/21/2021, 2:55 PMnamespace EndPoints {
private const val API_PATH = "<http://localhost:8080>"
const val WELCOME = API_PATH + "/welcome"
}
frank
02/21/2021, 3:33 PMCurrently I'd say that if you do need the context for clarity then use the object method, and if you don't really need it then just have an appropriately-named package.I'm going to continue adding context to the name for now to see if I run into complications.
Youssef Shoaib [MOD]
02/21/2021, 3:44 PMMatteo Mirk
02/22/2021, 2:16 PM