Entity Modelling

www.entitymodelling.org - entity modelling introduced from first principles - relational database design theory and practice - dependent type theory

## Messaging Matrices

In mathematics, a matrix is a rectangular array of numeric elements, as for example the matrix
 23 15 29 22 31 6 9 8 -1 8 17 52

having 3 rows and 4 columns. Though, this is essentially 2 dimensional (we gave the two dimension model in figure 28) , the content can be communicated in a linear message either row by row as [23,15,29,22] followed by [31,6,9,8] then [-1,8,17,52] which we can describe by the message structure

```
matrix => row*

row => element*
```
or column by column as [23,31,-1] then [15,6,8] then [29,9,17] then [22,8,52] which we can describe by the message structure
```
matrix => column*

column => element*
```

As you see with this example, each element of any matrix is both part of a row and part of a column and so, as with the previous marriage entity, the element entity is modelled as a subordinate to two others of different types as shown in figure 28. The two ways of communicating the matrix correspond to the two branches of this entity model. The row by row communication is described by this model: and the column by column communication by this one: ### Communicating Hierarchy - XML

Whereas, matrix structure, as considered in the previous section, is essentially 2 dimensional, hierarchically structured information may be flattened into a linear i.e. 1 dimensional structure in which nesting of detail represents the hierarchy. XML is a language designed for this purpose.

In the XML language communication of a hierarchically structured entity, each type X of entity is enclosed by its own parenthesis in the form of character sequences for start and end element; this message that follows these conventions1:

```

<matrix>
<row>
<element>23</element>
<element>15</element>
<element>29</element>
<element>22</element>
</row>
<row>
<element>31</element>
<element>6</element>
<element>9</element>
<element>8</element>
</row>
<row>
<element>-1</element>
<element>8</element>
<element>17</element>
<element>52</element>
</row>
</matrix>

```

We continue this subject of hierarchy versus matrix structure in the next section: information structure choices

1 I have written the message on many lines and indented to make more readable