Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo,

frage mich grade wie man wohl List<T>, Properties und ähnliches korrekt in UML darstellt? Als stereotyp property z.B.?

Beispiel List<T>:
A.) +Operation(name : List<T>) : List<T>
B.) <<List>> +Operation(name : List<T>) : List<T>

Beispiel property:
A.) +Attribute : string
B.) <<property>> +Attribute : string


Bei 1 würde ich A nehmen, bei 2 allerdings B, finde im Netz leider sehr viel unterschiedliches dazu..

Bearbeitet von Daniel.Koerner

  • 2 Wochen später...

was genau soll das <<List>> ggf. <<property>> machen?... 

Ich denke die Klasse List<T> "könnte" zB. den Stereotyp <<collection>> angehören, was seine Attributen und Operationen betrifft sehe ich kein Gebrauch von Stereotypen nötig.

bei  beiden A...

  • Autor

Ich wollte auf die C#-Spezifischen Elemente "List<T>" (Collection) und die Properties abzielen. Ich hab' da ja nicht wirklich Getter oder Settermethoden sondern Properties. Hintergedanken war dabei, dass UML ja eher etwas allgemeines darstellen soll statt Programmiersprachentypische Elemente.

Bei C# sind Properties ja eigentlich Attribute, allerdings werden diese ja im Endeffekt dazu verwendet, wofür man sonst Getter oder Setter-Methoden benötigen würde. Im übrigen geht es mir dann auch um {get; set;} - da man dort ja auch eine gewisse implementierung vornehmen kann.

Ich denke ich bleibe erstmal dabei, ohne stereotypen zu arbeiten. Bis nächste Woche ist ja noch Zeit das Projekt abzugeben.

 

Praxisbezogen habe ich etwa folgendes:

public class Beispiel
{
  public list<CopySet> CopySets { get; set; } = new List<CopySet>();
  public string Test { get; private set; }
}

public class CopySet
{
  // Konstruktor und Attribute etc.
}

 

  • Autor

Hab da was gefunden: http://stackoverflow.com/questions/27459257/how-to-represent-an-attributes-data-type-as-an-array-of-objects-on-class-diagra

0K3fA.png

Quote

Both are correct, but the second one, when multiplicity is set to more than one is used is more natural, and it is not necessary do define collection class as it is shown on the first picture of your example. Simply said, multiplicity defines how many instances of specific type can be stored by attribute. This set of instance can be ordered or duplicates in it may be allowed. Parameters of multiplicity element have impact on type of collection which should be used, Set, Vector, Array etc. But, if you need precise info about this issue, read UML Superstructure. Search for Property and Multiplicity Element.

 

Hat sich also erledigt, trotzdem danke :)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.