3 ms·
In practice the names are just not descriptive (of, from, newInstance, get) and I suspect this is because they're typically used to dynamically return implement
by vips7L 4y ago
In practice the names are just not descriptive (of, from, newInstance, get) and I suspect this is because they're typically used to dynamically return implementations at runtime so you don't know the name of thing you want. If you know the name of the thing you want ahead of time, isn't the constructor of the named type good enough?
- _benedict 4y agoA good example might be static constructors that indicate the semantics of the parameters, such as of(array), copyOf(array), ofSorted(array) Where perhaps the first wraps, the second copies and the third may wrap and avoid sorting the input. This would all of course depend on some conventions on meaning within the codebase.