Entity Modelling

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

Reference Attributes

When we look at the cover of a book and read the title, the author and the publisher then we are looking at a message and within the message we see character strings that can be modelled as attributes of a book entity type like so:

On reflection, we can distinguish the attribute title as being particular to the book and the other two attributes as not particular but, within the message, serving to identifying other entities. These other attributes that are not primarily properties of the subject entity in and by itself but which are indicative of a relationship between the subject entity and other entities we shall say are reference attributes 1. Reference attributes are those attributes which appear in messages communicating entities and singly or multiply serve to identify entities other than the subject of the message. Reference attributes are significant because they model the way that relationships may be communicated in messages or, more specifically, represented in databases. Understanding and modelling reference attributes is important because typically we form or aquire models working from given examples and these are represented to us in messages of various forms — all we have of entitites is by way of messages and in these messages almost all we have of relationships is reference attributes.

We have a notation for reference attributes so that if required they can be shown on entity model diagrams2. To model author and publisher as referential attributes then we need introduce individual and publishing company entity types, say, and introduce reference relationships as shown here:

We don't see all the possibilities in this single example but what we have done is to:
  • number the reference relationships R1, R2 and so on,
  • depict the reference attributes as non-core,
  • for each reference attribute identify, in parentheses3, the reference relationship(s) it wholy or partly communicates.

Now let us suppose that a book is uniquely identified by the combination of title and author and not just by its title alone. To document this in the entity model we show specify the author relationship by drawing a bar across the relationships line.

and see that now we underline the author name attribute for now this is an identifying attribute of book messages.

A example is given in figure 35 giving a simple model of molecular structure.


Figure 35
Model of molecular structure.

1 What we are calling here reference attributes are the foreign key attributes of relational database theory. Whatever we call them, and I personally struggle with this term from database theory, the concept is not purely a database concept — as a concept it is more important than this — it should be seen as a messaging concept.
2 Though one of my goals for this website is to show that reference attributes do not have to be explicitly modelled during software and database design; they can be automatically generated by software tools.
3 I have adopted this part of the notation from Sally Shlaer and Neil Lang. Shlaer-Mellor Method: The OOA96 Report. Technical Report, Project Technology, Inc., 1996.