Frage

Gibt es eine Standard (nicht-grafische) Notation für Entity Relationships?

jetzt meine eigene janky Notation Ich verwende:

  • Benutzer >> Foto, (1-many)
  • Benutzer> Profil, (1-1 hasOne)
  • Profil
  • Foto << Benutzer, (viele-1 belongsTo)
  • Photo <> Tag, (viele-viele)
War es hilfreich?

Lösung

Warum nicht gleich verwenden als in ER-Diagramme:

  • User 1-n Fotos
  • User 1-1 Profil
  • Foto n-1 User

und so weiter. Aber ich habe nie von einem offiziellen Klartext standart gehört.

Andere Tipps

Fast 10 Jahre später, und ich hatte auch eine harte Zeit zu finden Klartext Standards. Hier ist, was ich bisher (fair Warnung aber, es ist vor allem grafische Standards, der Arbeit gut in Text vorkommen) gefunden.

Zuerst wird der gemeinsame Begriff zur Beschreibung der Mächtigkeit einer Beziehung zwischen Objekten ist „Vielfalt“.

  

Diese Assoziation Beziehung zeigt an, dass (mindestens) einer der beiden verwandten Klassen Bezug auf die anderen machen. Diese Beziehung wird in der Regel als „A hat einen B“ (eine Mutterkatze hat Kätzchen, Kätzchen haben eine Mutterkatze).

     

Obwohl eine beträchtliche Anzahl von Quellen auch den Begriff „Mächtigkeit“ verwenden.  Es gibt ein paar gute Antworten über den Unterschied zu dieser Frage SO zu Multiplicity vs Cardinality . Ich fand dies als ziemlich kurz und knapp:

  

... eine Vielzahl aus einem unteren und einer oberen Mächtigkeit besteht. Eine Mächtigkeit ist, wie viele Elemente in einem Satz sind. Somit kann eine Vielzahl sagt Ihnen, die minimale und maximale erlaubte Mitglieder des Satzes.

     

UML Multiplicity Notation

UML ist Vielzahl Notation funktioniert gut in Text.

+--------------+--------+-----------------------------------------+
| Multiplicity | Option |               Cardinality               |
+--------------+--------+-----------------------------------------+
| 0..0         | 0      | Collection must be empty                |
| 0..1         |        | No instances or one instance            |
| 1..1         | 1      | Exactly one instance                    |
| 0..*         | *      | Zero or more instances                  |
| 1..*         |        | At least one instance                   |
| 5..5         | 5      | Exactly 5 instances                     |
| m..n         |        | At least m but no more than n instances |
+--------------+--------+-----------------------------------------+

Es scheint ein paar Variationen davon zu sein:

  • Microsoft Relational Notation

    +---------------------------------+---------------------+
    |          Multiplicity           |     Cardinality     |
    +---------------------------------+---------------------+
    | *                               | One to zero or more |
    | 1..*                            | One to one or more  |
    | 0..1                            | One to zero or one  |
    | 1                               | Exactly one         |
    | Two numbers separated by a dash | a range             |
    +---------------------------------+---------------------+
    
  • IBMs

    +------+--------------------+-------------------------------+
    | Rose | Software Architect |          Description          |
    +------+--------------------+-------------------------------+
    | n    | *                  | Unlimited number of instances |
    | 1    | 1                  | Exactly 1 instance            |
    | 0..n | *                  | 0 or more instances           |
    | 1..n | 1,,*               | 1 or more instances           |
    | 0..1 | 0..1               | 0 or 1 instances              |
    +------+--------------------+-------------------------------+
    
  • Martin Stil

Chen Style

was ich Chen Stil gelesen habe ist das „Originalformat“. Ich häufig sehen dies in Text wie folgt ausgedrückt:

+----------+--------------+
| Notation | Description  |
+----------+--------------+
| 1:1      | One to One   |
| 1:N      | One to Many  |
| N:1      | Many to One  |
| M:N      | Many to Many |
+----------+--------------+

IDEF1X ua

Es gibt IDEF1x (a NIST-Standard):

  

IDEF1X ist ein Verfahren zum Entwerfen von relationalen Datenbanken mit einer Syntax entwickelt, um die semantischen Konstrukte in notwendig zu unterstützen, ein konzeptionelles Schema zu entwickeln.

Das scheint die Min-Max / ISO-Notation zu beschreiben (die Englisch Link wird zur Zeit gebrochen, aber hier einen deutschen Artikel ) verwiesen von der Wikipedia Entity-Relationship-Modell Artikel, der auch ein paar andere Arten von grafischen Listen Notationen, von denen einige Textfreundlich sind.

Die deutsche Sprache Artikel auf (min, max) Notation hat auch eine nützliche Tabelle vergleicht UML, Chen, (min, max) und MC (Modified Chen) :

+----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+
| (min,max) [Entity 1] | [UML, Entity 1] |          Chen-Notation          | MC-Notation | [UML, Entity 2] | (min,max) [Entity 2] |
+----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+
| (0,1)                | 0..1            | 1:1                             | c:c         | 0..1            | (0,1)                |
| (0,N)                | 0..1            | 1:N                             | c:mc        | 0..*            | (0,1)                |
| (0,N)                | 1..1            | 1:N + total participation       | 1:mc        | 0..*            | (1,1)                |
| (0,N)                | 0..*            | M:N                             | mc:mc       | 0..*            | (0,N)                |
| (1,1)                | 0..1            | total participation + 1:1       | c:1         | 1..1            | (0,1)                |
| (1,N)                | 0..1            | total participation + 1:N       | c:m         | 1..*            | (0,1)                |
| (1,1)                | 1..1            | total part. + 1:1 + total part. | 1:1         | 1..1            | (1,1)                |
| (1,N)                | 1..1            | total part. + 1:N + total part. | 1:m         | 1..*            | (1,1)                |
| (1,N)                | 0..*            | total participation + M:N       | mc:m        | 1..*            | (0,N)                |
| (1,N)                | 1..*            | total part. + M:N + total part. | m:m         | 1..*            | (1,N)                |
+----------------------+-----------------+---------------------------------+-------------+-----------------+----------------------+
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top