clojure - Architecture for plugins to be loaded in runtime -


considering developing end-user software program (as uberjar) wondering options make possible user download plugin , load during runtime.

the plugin(s) should come compiled , without source code, sth. load not option. existing libraries (or ways of java...?) exist build on?

edit: if not sure satisfied way costs reboot/-start of main-program. however, important source-code won't included in jar file (neither main application nor plugin-jars, see :omit-source of leiningen documentation).

to add jar during runtime, use pomegranate lets add .jar file classpath. plugins of software should regular clojure libs follow conventions need establish:

  1. make them provide (e. g. in edn) symbol object implementing constructor/destructor mechanism such lifecycle protocol in stuart sierras component library. in runtime, require , resolve symbol, start resulting object , hand on rest programs plugin coordination facilities.

  2. provide public api in program allows plugins interact in ways coordinate asynchronously e. g. clojure.core.async (don't let 1 plugin block entire program).

  3. make sure plugins have coordinated way expose functionality each other if desire enable high degree of modularity among plugins. make sure plugin loader capable of detecting dependencies among plugins , capable of loading , unloading them in right order.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -