Basic concepts

Service-Oriented development

When developing with XPE, you should follow a Service-Oriented approach, which is quite different traditional OO based approach.

XPE application

In XPE, each Service is provided by a Resource. A Resource is anything that has a URI. Therefore, a Service itself is also a Resource but a Resource may not be a Service. A similar concept in traditional programming languages to URI is namespace. Just about everything in XPE is a resource.

To be more specific, a Service in XPE is provided by an XML Pipe (XPipe), which is made of a number of XML Pipe Nodes (XNode). There are three types of XNodes:

  • XSource, an XNode that generates XML event stream from an XML or non-XML data source.
  • XFilter, an XNode that reacts to an XML event stream.
  • XSink, an XNode that serialise an XML event stream into XML document or non-XML data format.

Writing a Service under XPE is very nature. When providing a Service, one usually starts thinking the input and output, which are handled by selecting the right XSource and XSink. Next, one divides the process of providing a Service into a number of smaller steps. Each step is then modelled by a XFilter. The best analogy to a Pipe is an assembly line.

XPE introduces a number of architectural constraints so optimal system attributes (performance, scalability, extensibility etc) can be achieved:

  • Every XPipe is a linear sequence of XNodes. No branching is allowed. This improves the visibility of a pipe so development and maintenance become really easy.
  • Every filter should only react to the XML fragment that it understands fully while ignoring others it does not understand. This allows new features to be introduced dynamically without breaking existing functionality.