Re: Representing Key Constraints in UML based Conceptual Data Models

Re: Representing Key Constraints in UML based Conceptual Data Models

From: Pieter Van Gorp <>
Date: Thu, 30 Apr 2009 17:45:43 +0200
Message-ID: <>
Hi Daniel, hi all,

On Thu, Apr 30, 2009 at 2:49 PM, Daniel Jackson <> wrote:
> Can you post your question? I clicked on your link but messages are only
> visible to group members and it's too much hassle to sign up.
Sorry to have overlooked that.  Indeed it would be too much hassle so
here's a copy of the thread.

--- In, Scott Ambler <scottwambler@...> wrote:
> --- On Thu, 4/2/09, Muntasir Rahman <muntasir.rahman@...> wrote:
> <snip>
> > - unique constraint value of a member field. For example:
> > "an ISBN is unique value for Book class"
> Easist thing is to use a note, see for examples.
> You could also use OCL, but few people actually know it.
> If ISBN is some form of key, see

--- In, "pietervangorp" <pieter@...>
wrote on Tue Apr 14, 2009 6:31 pm:
I am currently documenting an operational database and I am confronted with a
key-related modeling problem as well. On you find a fragment where I
apply <<K>> to denote natural keys of the tables underlying particular classes
(User and Host). The diagram is at the level of *logical* data modeling.
Therefore, I have not mapped the three associations to attributes (that would
correspond directly to table columns).

The problem I am faced with now, is that (or any other
data modeling source I am aware of) does not provide a means to model the
InternetAccess(user,host) key from the underlying database. On I show two OCL constraints
that do formalize the intended constraint but I am looking for a more readable
modeling style. I do not consider the OCL readable, because:
1) database administrators may not know the OCL (see comment from Scott),
2) I need to specify the constraint from two sides explicitly.

I think (2) is a bigger problem than (1) because the OCL example is based on
straightforward logics and may be comprehensible even to people that are
unfamiliar with the language. No matter what, I think the OCL application shown
in the example is bad style.

I have some old, rough experience on but
at the time (2003?) I did not consider the need to include (to-one) association
ends in key definitions either...

As potential solutions, I am thinking of and Both approaches raise
new issues from a tooling perspective (it is impossible to use AssociationEnd as
types in in TagDefinitions) but currently I am primarily interested in:

1) have others ever wanted to include association ends in natural key
2) what (informal) syntax have others applied?

Kind regards,
and thanks in advance for your input,
Pieter Van Gorp
Received on Thu 30 Apr 2009 - 16:45:49 BST