I am developing a library. I want some functionality to be additionally available in case a certain other library is in the classpath. My understanding is:
- there would be a buildtime dependency, since I import from that lib and use it in places
- runtime dependency is there only if the code path reaches the point where I am using something from that library
Am I correct?
Yes.
I would it name execution path. At any time the code in execution will reach some
a.A a = new a.A();And if class a.A is not on your classpath it will throw a Runntime Exception. That mean you have to run and reach this point to get an error. If your program don’t reach this point it never fails.