NetKernel News Volume 4 Issue 8 - Artisan vs Engineer Discussion, HTML5 Frameworks

NetKernel News Volume 4 Issue 8

March 1st 2013

Catch up on last week's news here, or see full volume index.

Repository Updates

The following updates are available in the NKSE and NKEE repositories

  • html5-frameworks-1.1.1
    • New HTML5 javascript and css framework server module (see below).
  • wiki-core-1.10.1
    • Fixed slinki bootstrap to deal with whitespace on Windows. Tweaked the slide macro to ensure reveal.js page offsetting works.

New: HTML5 Frameworks

There are now a growing number of "essential" HTML5 javascript and CSS frameworks that any self-respecting HTTP server would want to provide. We found that we have been repeatedly including our own local copy of tools for each solution but this was untidy and meant that we weren't tracking newer capabilities very frequently.

Tom Geudens and I collaborated to produce a NetKernel module that serves several of the most popular frameworks. Its called html5-frameworks and is now available in the repositories.

The important things to note are:

  1. It uses the RESTOverlay to provide a very efficient server with automatic SHA1 ETags and compression.
  2. It has a latest convention in the REST path so that you can "permalink" your own solution to a stable framework resource that will provide the most recent generation of a given technology.
  3. You can customize the framework server to deploy your own libraries and get all the same benefits.

This site is now using the framework server. Here, for example, is bootstrap.min.css

Below is the introduction to the documentation. (After installation you'll find the full documentation and REST API here).

This module provides a single convenient deployment of common HTML5 web frameworks.

  • AngularJS
  • Bootstrap
  • D3.js
  • Font-Awesome
  • html5 shiv
  • JQuery

HTTP Response

The framework server is dynamically imported into the Frontend Fulcrum.

The RESTOverlay is used to wrap the libraries. It provides the following features for all libraries:

  1. SHA1 ETags for the served resource for long term 304 negotiation
  2. Automatic negotiated resource compression. This is in addition to existing minification of a given library and provides for highly efficient network optimisation. For example, bootstrap.min.css goes from 103kB to 16kB.
  3. Each served resource has an HTTP EXPIRES header one day in the future and Cache-Control max-age of 86400.

Here is an example of the HTTP response header for a resource from the module...

Cache-Control	public, max-age=86400
Content-Encoding	gzip
Content-Length	42226
Content-Type	application/x-javascript
Date	Thu, 28 Feb 2013 12:48:23 GMT
Etag	"1a59be663dd3695b34e37c3a19663e8170a564ba"
Expires	Fri, 01 Mar 2013 12:48:23 GMT
Last-Modified	Thu, 28 Feb 2013 12:48:23 GMT
Server	NetKernel [NetKernel Enterprise Edition 5.1.1] - Powered by Jetty

Latest Convention

By convention a REST interface containing the word latest will give a stable alias for the latest available implementation of a given technology.

Also specified are versioned interfaces for long-term stability.

New: NetKernel Gradle Plugin - Release 0.1.2

Brian Sletten and Randy Kahle have announced the first public release of a NetKernel Gradle Plugin. This community project provides a powerful capability to build, deploy and manage your modular NetKernel solutions.

The first preview announcement of the plugin was made about a year ago. At the time we provided the following article with a getting started discussion:

NK Gradle Plugin - Getting Started Guide

The exciting news is that the tool now supports module template libraries. Which means you can rapidly spin up a customizable solution from an existing blueprint (your own, or one of the community contributions).

Below are a set of informal release notes from Randy which give a picture of some of the capabilities...

Very cool stuff - a big thanks to all of those that have contributed to this project, and no doubt the project would welcome your involvement...

We've made a lot of progress on the Gradle plugin. It's now in a state that you can start to use and contribute.

There are two GitHub repos:


The first is the Gradle plugin for NetKernel. While still very young, it can now create NetKernel modules for you from templates. The second repo is the set of shared module templates.

Much more will be made automatic, but for now:

  1. Always have an instance of NetKernel installed and running
  2. Have the modules.d feature turned on.

After you do the normal fork/clone of the GitHub repos, build the gradle plugin (follow the directions in the README).

Create a directory and include a build.gradle:

apply plugin: 'netkernel'

buildscript {
  repositories {
  dependencies {
    classpath group: 'org.netkernelroc.gradle', name: 'netkernel-gradle-plugin', version: '0.0.6-SNAPSHOT'

Now you can:

gradle tasks

to see the available tasks

gradle statusNetKernel

to report on NetKernel status

The one area you can start to work on if helping us build a set of module templates. Check out the createNetKernelModules task. Basically, you can set parameters to point to your local repo of the templates and then do this:

gradle createNetKernelModules -PmoduleURI=urn:org:netkernelroc:mymodule -PmoduleTemplate=simple -PmoduleLibrary=default -PtemplateDirectory=/path/to/your/template/repo

and this will create a module from the specified template. (You can put some of these parameters in ~/.gradle/ to save typing)

Then you can

gradle installNetKernelModules

and it will find NetKernel and create the necessary modules.d/project.xml file to point to your modules - automatically loading them into NetKernel.

when done

gradle removeNetKernelModules

and you have reverted the 'modules.d/ changes.

So -- what can you do now? You can start to create your own module templates...

Check out the ones already in the repo for ideas. All files you put into repo areas will be copied and variable substitutions will occur for things like MODULE_URI, MODULE_CLASSPATH, and MODULE_URI_WITHOUT_URN (removes the urn: prefix). Study the existing files for example uses.

The pace of development on this plugin is picking up, so follow the repos to see the progress.

Cheers -- Randy

I added the notion of a moduleSet to the installNetKernelModules and removeNetKernelModules tasks.

This allows you to have a file:


in your project with, e.g.:

sales = [ 'urn:net:databliss:module', 'urn:net:databliss:module:test' ]
ui = ['urn:net:databliss:module']

and then say:

gradle installNetKernelModules -PmoduleSet=ui

and only the modules specified in that set are added to modules.d

Jay asked for this so that he could have the ability to quickly switch between "working sets" of modules.

Let me know how this works for you...

The plugin is now at version 0.1.2.

In this release I added a feature Jay requested which provides support for "moduleSets". This is a way of describing a sub-set of the module you are working on and give it a name (such as "ui", "testing", etc.). You can then install the modules for the named moduleSet.

Also included are numerous bug fixes and minor enhancements.

Artisan vs Engineer - Discussion

Steve Cameron has provided a very thoughtful commentary on last week's newsletter item.

I don't have time to follow-up today - but I do have many thoughts still to share. However, I strongly concur with Steve that real-world engineering is as much an instinctive creative art as a formal science.

Incidentally, I'm re-reading Babbage's book - the second half describes his methodology and offers a view on the economics of industrialized production on cost, price and value. Its good stuff - but beware you'll find yourself starting to talk in the style of a Victorian.

It would be very interesting to create a questionnaire, following his methodology outlined in Chapter 12, but targeted at the economic measurables of information solutions.

Have a great weekend.


Please feel free to comment on the NetKernel Forum

Follow on Twitter:

@pjr1060 for day-to-day NK/ROC updates
@netkernel for announcements
@tab1060 for the hard-core stuff

To subscribe for news and alerts

Join the NetKernel Portal to get news, announcements and extra features.

NetKernel will ROC your world

Download now
NetKernel, ROC, Resource Oriented Computing are registered trademarks of 1060 Research

© 2008-2011, 1060 Research Limited