Sketches for a Software System Definition Using Xml

A software system design should be represented as an Xml document. Xml can be easily generated from visual models or object models, and other representations can be easily generated from Xml.

Here´s a first draft of how such a system defintion could look like:

<System name="MyApplication" mainboard="Main" entryPin="Run">
  <!-- <Import assembly="mscorlib" /> The most important .NET Fx assemblies are imported automatically into every <System>
         to make available their data types as message types -->

  <Import assembly="someAssemblyNameWithoutExtension"/> <!-- Imports all types from the assembly -->
  <Import assembly="anotherAssembly" include="*.instrumentation.*">
         <!-- Import only types whose names are matching the include-filder -->
    <Alias name="myLogger" typename="anotherAssembly.instrumentation.SimpleLogger"/>
         <!-- assign an alias to a type from an imported assembly -->

  <Board name="Main">
    <Wire fromPin="SomePart.SomeOutputPin" toPin="OtherPart.SomeInputPin" messageType="string"/>
      <!-- Pins are qualified by component name and pin name -->
      <!-- Components which are not boards and are not imported are parts that need to be implemented -->

    <Wire fromPin="SomePart.OtherOutputPin" toPin="Sub.SomeInputPin" messageType="IEnumerable{int}"/>
      <!-- Pointed brackets can be replaced by curly braces in message type definitions -->

    <Wire fromPin="Sub.SomeOutputPin" toPin="Global.SomeInputPin" 

    <Wire fromPin="this.Run" toPin="Sub.Main" messageType="string[]" />
      <!-- To delegate messages to/from a board´s pin to some pin of it´s components use "this" to refer to the aggregating board -->

    <Wire fromPin="MultiPart#a.SomePin" toPin="MultiPart#b.AnotherPin" messageType="int"/>
      <!-- Components can be used multiple times on a board. For each usage a new instance is created.
            To refer to particular instances add "#instancename" after the component name -->     

    <Board name="Sub"> <!-- A board defined by nesting it inside another board -->

  <Board name="Global"> <!-- A globally defined board; can be referenced inside any board, except ones nested boards -->

A functionality of a software system is described by a hierarchy of Event-Based Components. Each component is either part or board. Boards just wire-up/connect parts, parts are atomic and are the sole carriers of domain logic.

All components have a name and a number of output/input pins. The pins are not defined explicitly. They need to be inferred from the wires defined inside a board.

A software system has a single board as its root, the mainboard. After creating all components it is started by sending a message to the mainboard´s entry pin.

Some lexical rules

  • Component names are C# identifiers (possibly including a namespace)
  • Pins are referenced like this: componentName " "." pinIdentifier
    • instanceKey is just some unique string to distinguish instances; it could be a name, a number, or a guid
    • pinName is an identifier without a namespace (it will likely be translated into a method name or field name)
    • messageTypes are given as they would in C# source code; "<" and ">" can be replaced with " and " to avoid "&lt;" and "&gt;"

Last edited May 14, 2010 at 12:37 PM by ralfw, version 10


No comments yet.