O'Reilly logo

Resource-Oriented Computing with NetKernel by Tom Geudens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Incision, Right Here

This chapter will explain the what, how and why of First Module. We will also create a module using the Webserver Pattern.

Inside [moduleroot]/module.xml

If were awake during the previous chapter, you noticed that the [moduleroot]/module.xml file contains most of the meat. It does in fact have two main purposes:

  1. Define your module.

  2. Define the ROC layout of your module.

Number one is obvious, and number two is important. If your ROC layout is done well, putting the rest of your module together will be easy (and short). So let’s study it in detail.

Template

Let’s start with a simple module.xml template.

<module version="2.0">
  <meta>
    <identity>
      <uri>urn:org:yourcompany:yourapplication:newmodule</uri>
      <version>0.0.1</version>
    </identity>
    <info>
      <name>New Module</name>
      <description>New Module Template</description>
    </info>
  </meta>

  <system>
    <dynamic/>
  </system>

  <rootspace>
  </rootspace>
</module>

Note

Having good templates available can seriously reduce your development time. You do not need a fancy system to manage them, though some editors have one, and if you feel comfortable with it, by all means use it. A simple directory will do. Make sure to put them under version control as well though!

The template contains nothing special:

<meta>

This contains the description of your module. Do note the use of colons in the URI.

<dynamic>

With <system><dynamic/></system> we indicate two things:

  1. Any change to [moduleroot]/module.xml will cause a hot reload of the module. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required