Hosted by Three Crickets

Prudence
Scalable REST Platform
For the JVM

Prudence logo: bullfinch in flight

Upgrading from Prudence 1.1

Prudence 1.1 did not use Sincerity: instead, it was a self-contained container with everything in the box. This meant it could also not be modular, and instead supported several distributions ("flavors") per supported programming language. Rather than standardizing on a single language for bootstrapping code, and indeed the project maintained a separate set of bootstrapping code for each supported language.
This was not only cumbersome in terms of documentation and maintenance, but it also made it hard to port applications between "flavors."
With the move to Sincerity in Prudence 2.0, it was possible to make Prudence more minimal as well as more modular, as Sincerity handles the bootstrapping and installation of supported languages. Though Sincerity can ostensibly run bootstrapping scripts in any Scripturian-supported language, it standardizes on JavaScript in order to maintain focus and portability. The bottom line is that if you used non-JavaScript flavors of Prudence 1.1, you will need to use JavaScript for your bootstrapping scripts, even if your application code (resources, scriptlets, tasks, etc.) is written in a different language.
To be 100% clear: all "flavors" supported in Prudence 1.1 are still supported in Prudence 2.0, and your application code will likely not even have to change. You only need (or rather, are recommended) to use JavaScript for bootstrapping.

Upgrading Applications

There are no significant API changes between Prudence 1.1 and Prudence 2.0. However, the bootstrapping and configuration has been completely overhauled. You will likely need to take a few minutes to rewrite your settings.js, routing.js, etc. Here is a step-by-step checklist:
  1. Start with a new application based on the default template.
    1. Rename old application (add "-old"), for example: "myapp-old"
    2. Use the "prudence" Sincerity tool to create a new application for your application name:
      sincerity prudence create myapp
      
  2. Copy over individual settings from settings.js, using the new manual to find equivalences.
  3. Redo your routing.js, using the new manual to find equivalences. Prudence 2.0 uses a far more powerful and clearer routing configuration.
  4. Rename "/resources/" files to add a ".m." pre-extension (they are now called "manual resources"). Under Unix-like operation systems, you can rename the all files in the tree via a Perl expression using something like this:
    find . -name "*.js" -exec rename -v 's/\.js$/\.m.js/i' {} \;
    
  5. Rename "/web/dynamic/" files to add a ".t." pre-extension (they are now called "template resources"). Under Unix-like operation systems, you can rename the all files in the tree via a Perl expression using something like this:
    find . -name "*.html" -exec rename -v 's/\.html$/\.t.html/i' {} \;
    
  6. Merge "/web/dynamic/" and "/web/static/" into "/resources/".
  7. Move "/web/fragments/" to "/libraries/includes/".

The Prudence Manual is provided for you under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The complete manual is available for download as a PDF.

Download manual as PDF Creative Commons License