The general consensus of naming convention in Java (and Kotlin) for interfaces is to add -able to the end of the proposition. e.g. Composable, Iterable, etc.
We are dealing with data objects that may or may not have a range in which it resides. e.g. a diagnose can have a start and an end date. Rangeable isn't a proper word, neither are periodable and other suggestions. I can't find if the proper naming convention thinks this is a good idea anyway. Any suggestions?
s
Sam
05/23/2023, 1:25 PM
The start and end are things that the object has, not things you can do to it, so ‘-able’ doesn’t fit so well. What about a different adjective like “bounded” or “finite”?
As an aside, I think giving interfaces special names in ‘-able’ (or adjectives in general) is probably only occasionally appropriate, rather than being a general convention. Most of the time, a consumer shouldn’t need to know or care whether it’s dealing with an interface or a class.
y
Youssef Shoaib [MOD]
05/23/2023, 1:32 PM
Something like
Dated
could work as well here. I think it's sort of a convention to use adjectives for interface names.
k
Klitos Kyriacou
05/23/2023, 2:41 PM
List, Map, Comparator and many other interfaces are nouns.