Thursday, December 12, 2013

Sapphire 0.7 : On-Demand Element Compilation

In past releases, Sapphire used a Java annotation processor linked to @GenerateImpl annotation to produce implementation classes for model element interfaces at build time. This system has been replaced by on-demand compilation straight to Java bytecode. When application code instantiates an element for the first time, Sapphire will automatically compile it and use the compiled result for the duration of the JVM instance.

This approach has several advantages.

  1. Easier getting started process since customizing the build to compile implementation classes is no longer necessary
  2. Smaller footprint for applications as implementation classes do not need to be distributed and stored
  3. Faster element instantiation as the bytecode generator is faster than most disk systems

No comments: