There are dependencies that do not load all their classes into ClassLoader
due to the cost of loading, and even because they can have several separate modules in several Jars.
Imagine the following:
Process of generation of documents
- The library that is used in those documents
pdf
, excel
and word
, also in this library, there are interfaces to make the generation of other formats more flexible by third parties
- For the generation of each document type, there is a series of classes, perhaps even another complete module (another JAR)
- Your application will not present compilation error in the absence of these extra Jars, since it is the document generation library that uses them
- At the time of generation of these documents, the library will load the related classes that can provide the desired generation (
pdf
, excel
, word
...)
That’s what the scope is for runtime
, you know that one day you can use that module for some functionality, but you don’t use that dependency directly on your code.