0

I have one application which uses external APIs (JAR). These external APIs are having two versions. Depending on standard of that particular data, it has different implementation and schema, hence we have two separate dependencies: 2.2.0 and 2.0.1. Both dependencies have the same method signatures. I was thinking just to replace the APIs at run time depending on schema.

Is it possible to change the dependencies at run time?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Ram
  • 233
  • 1
  • 17
  • 1
    You probably could do it with custom class loaders, but I'd avoid it if I could. – Mark Rotteveel Aug 30 '22 at 09:38
  • Does this answer your question? [How to load JAR files dynamically at Runtime?](https://stackoverflow.com/questions/60764/how-to-load-jar-files-dynamically-at-runtime) – Joe Aug 30 '22 at 09:42

1 Answers1

-3

Spliting the two dependencies to two service, then you can call them by yourself