Sie sind auf Seite 1von 17

Zusammenfassung

SYP Modellierungsmuster, Sequenzdiagramme usw.

Markus Paller
25.3.2015

Inhalt
Sequenzdiagramm .............................................................................................................................................. 2
Szenario .......................................................................................................................................................... 2
Geschftsprozess und Szenario ....................................................................................................................... 2
Notation Szenario ........................................................................................................................................ 2
Sequenzdiagramm .......................................................................................................................................... 2
Classes ................................................................................................................................................................ 3
Introduction.................................................................................................................................................... 3
Constructive steps to identify classes .............................................................................................................. 3
Analytical steps to validate classes ................................................................................................................... 3
Associations ........................................................................................................................................................ 4
Goal ................................................................................................................................................................ 4
Constructive Steps to Identify Associations ..................................................................................................... 4
Analytical Steps to Validate Associations ........................................................................................................ 4
Analysis Pattern .................................................................................................................................................. 5
General ........................................................................................................................................................... 5
List Pattern ..................................................................................................................................................... 5
Copy Type Exemplartyp ............................................................................................................................... 6
Construction Group Baugruppe.................................................................................................................... 6
List of Components Stckliste ...................................................................................................................... 7
Coordinator Type ............................................................................................................................................ 7
Group ............................................................................................................................................................. 8
Group History ................................................................................................................................................. 8
History Type ................................................................................................................................................... 9
Role ................................................................................................................................................................ 9
Alternating Role ............................................................................................................................................ 10
Beispiele ........................................................................................................................................................... 11
Sequenzdiagramme ...................................................................................................................................... 11
Test-Beispiel: ............................................................................................................................................ 12
Design Pattern .............................................................................................................................................. 13
Alternating Role........................................................................................................................................ 13
Copy Type................................................................................................................................................. 14
List Pattern ............................................................................................................................................... 14
Construction Group .................................................................................................................................. 14
Group ....................................................................................................................................................... 15
Test-Beispiele ........................................................................................................................................... 15
Test-Fragen................................................................................................................................................... 16

SYP Zusammenfassung

Markus Paller

Seite 1 von 16

Sequenzdiagramm
Szenario

Sequenz von Verarbeitungsschritten, die unter bestimmten Bedingungen auszufhren ist


Schritte sollen das Hauptziel des Akteurs realisieren und entsprechendes Ergebnis liefern
Beginnen mit auslsendem Ereignis und werden fortgesetzt, bis das Ziel erreicht ist oder
aufgegeben wird

Geschftsprozess und Szenario

Geschftsprozess wird durch Kollektion (Sammlung) von Szenarien dokumentiert


Jedes Szenario wird durch eine oder mehrere Bedingungen definiert, die zu einem speziellen
Ablauf des Geschftsprozesses fhren
Zwei Kategorien von Szenarios:
o Erfolgreiche Bearbeitung des Geschftsprozesses
o Fehlschlag

Notation Szenario

Szenarien werden durch Interaktionsdiagramme modelliert


Zwei Arten von Diagrammen
o Sequenzdiagramm
o Kollaborationsdiagramm

Sequenzdiagramm

Zwei Dimensionen
o Vertikal: Zeit
o Horizontal: Objekte
Objekt
o Objektsymbol
o Vertikal gestrichelte Linie (Objektlinie)
Bedingung
o [<Bedingung>] Operation()
Wiederholung
o *Operation()
o *[Bedingung] Operation()

SYP Zusammenfassung

Markus Paller

Seite 2 von 16

Classes
Introduction

Class Diagram
o Static model
o Showing
Classes (attributes)
Associations
Inheritance
o Operations will be added after the diagram is established
Separate Class Diagram for each Use Case
Model creation is based on the appropriate Abstraction Level
Base Information material for identification of classes
o Use Cases
o Formulars describing a working process
o Lists
o Documents

Constructive steps to identify classes

Analysis of Documents
o Attributes gathered to classes
o Bottom-up Method
Class = Unity of Attributes
o Find associations
Description of Use Cases
o Top-down Method
Find classes and then the attributes
o What are candidates for classes (nouns)
Classification by Categories
o A person can have several roles in a system
Each role is a class
o Actions that store Data
Money transaction in a bank
o Further Categories
Things, Organisations, Container, Catalogue, Event, Contracts

Analytical steps to validate classes

Class Name
o Make a class diagram understandable
o Express the sum of all attributes
Degree of Abstraction
o Neither too many nor too few numbers of classes
o Define class methods, that belong to all methods

SYP Zusammenfassung

Markus Paller

Seite 3 von 16

Associations
Goal

Find the necessary associations in a Use Case that its Objects can accept their responsibilities
Just draw lines between classes
Find the multiplicities of the associations
Specify the associations
o Simple association
o Aggregation/Composition

Constructive Steps to Identify Associations

Analysis of the Document


o Which Objects are in relation (association)
Categories
o Is A a component of B?
o Is A member of B?
o Does A use B?
Restrictions
o Best way to find restrictions: Object Diagram
o Sequence is relevant: {ordered}
o Two or more association: {or} or {subset}

Analytical Steps to Validate Associations

Role of the Association


o Check the role of each association in a class diagram
o Name the association
1:1 Association: 2 objects must be modelled, if
o An association can be changed (optional)
o Both objects are comprehensive
N-ary Associations
o Associations must have different roles
o Associations must have different names

SYP Zusammenfassung

Markus Paller

Seite 4 von 16

Analysis Pattern
General

Analysis Pattern
o Conceptional model which
Describes the solution of problems that behave similarly
Is a set of object and their unchangeable responsibility

List Pattern

Association is treaded as an aggregation


The whole consists of parts of the same type
o Only one part class
Part objects are permanently assigned to the aggregation object
Parts can be deleted while the whole still exists
The attribute values of the aggregation object apply to the part objects
The aggregation object contains at least one part object

SYP Zusammenfassung

Markus Paller

Seite 5 von 16

Copy Type Exemplartyp

The association link can be treated as a simple association link


o No aggregation
Association links are permanent/immutable
o Will be deleted if a copy is removed
Name of a new class usually contains terms like
o Type, Group, Description, Specification
Description-Class may exist even if there are no copies available (for a certain time)

Construction Group Baugruppe

Object under discussion is a physical object


Association links resemble compositions
Association links usually exist for some time
The whole can exist of different parts

SYP Zusammenfassung

Markus Paller

Seite 6 von 16

List of Components Stckliste

Association is a composition
Aggregation object as well as its parts must be treated as a unity (copy, delete)
It must be possible to treat each object within the unity as individual objects
Multiplicity: 0..1
An object of type A can be composed of objects of type A, B and C

Coordinator Type

Does generally not possess many attributes and methods


Association class can be considered as a special case
Goal: The main task of a coordinator is to remember which object knows which object
Associations are of simple type
Resolves a n-ary association into binary associations
Has associations to all other classes, generally to exactly one object of each class

SYP Zusammenfassung

Markus Paller

Seite 7 von 16

Group

Simple association link


Several individual objects belong at a certain time slice to the same group object
You have to check whether the group can exist without individual objects for a certain time
or whether there must exist a minimum number of individual objects at any time
Association links can be established and deleted whenever it is necessary

Group History

Individual object is associated in course of time to different group of objects


The history will be modelled in an associative class
The restriction {t=k} specifies the cardinality at a certain time
Since information during a period has to be registered associations cannot be removed,
whereas forth coming associations will be established

SYP Zusammenfassung

Markus Paller

Seite 8 von 16

History Type

Simple Associations
For each object all activities have to be modelled
For each activity the time period has to be registered
Object associations between employee and activities will evolve as long as the affiliation
exists. The restriction indicates what activity is active at the moment

Role

Between two classes there are two or even more simple association links
An object can play different roles in relation to objects of another class
Objects playing different roles have the same attributes and often the same methods

SYP Zusammenfassung

Markus Paller

Seite 9 von 16

Alternating Role

Ein Objekt der realen Welt kann zu verschiedenen Zeiten verschiedene Rollen spielen, in
jeder Rolle kann es unterschiedliche Eigenschaften und Operationen besitzen
Die unterschiedlichen Rollen werden mittels Vererbung modelliert
Objektverbindungen zwischen den Objekten und seinen Rollen werden nur erweitert, d.h.
weder gelscht, noch zu anderen Objekten aufgebaut

Aufgabenstellung:

Ein registrierter Arzt bt im ersten und zweiten Halbjahr 1998 in unterschiedlichen Praxen
jeweils eine Ttigkeit als angestellter Arzt aus. Mit 1.1.1999 herhlt er eine Zulassung.
Anmerkungen
Fr angestellte rzte sind teilweise andere Informationen zu speichern, als fr die
zugelassenen.
Die Informationen sind ber einen Zeitraum festzuhalten.
Neurztliche Ttigkeiten sind zu einem registrierter Arzt immer nur hinzuzufgt.

SYP Zusammenfassung

Markus Paller

Seite 10 von 16

Beispiele
Sequenzdiagramme

SYP Zusammenfassung

Markus Paller

Seite 11 von 16

Test-Beispiel:
Auf einer Online-Plattform (Forum) knnen Fragen an alle User gestellt werden, die gerade online
sind. Eine Zentrale (Server) verwaltet smtliche User. Wenn jemand eine Frage an das Forum stellt,
prft die Zentrale, wer online ist und gibt die Frage an die Online-User weiter. Die Frage soll so vom
Forum beantwortet werden.
Zeichne das Sequenzdiagramm und das Klassendiagramm.

SYP Zusammenfassung

Markus Paller

Seite 12 von 16

Design Pattern
Alternating Role
Problem:
Ein Professor unterrichtet whrend der Schulzeit an einer HTL. Daher hat er auch Ferien. Allerdings
arbeitet er auch zustzlich als Kursleiter am WIFI und hat dort spezielle Kursarten. Prinzipiell hat der
Professor ein Fachgebiet, auf dem er spezialisiert ist.
Anmerkungen:

Fr den Kursleiter sind teilweise andere Informationen zu speichern, als fr den HTL
Professor.
Die Informationen sind ber einen Zeitraum festzuhalten.
Das Fachgebiet ist zu einem Professor immer nur hinzugefgt.

SYP Zusammenfassung

Markus Paller

Seite 13 von 16

Copy Type
Problem:
Ein Softwareunternehmen hat ein Programm entwickelt. Dieses Programm hat eine eindeutige
Softwarenummer, einen Autor als Programmentwickler und ein Release Datum.
Von diesem Programm werden Kopien <Exemplare> verkauft. Daher knnen wir die Eigenschaften
vom Programms von den Kopien trennen.
Lsung:

List Pattern
Problem:
A country (Staat) consist of general country information and the individual federal states
(Bundeslnder). A federal state does not exist without a country. General country information belong
to any federal state.
Solution:

Construction Group
Problem:
A computer consists of exactly one motherboard and four fans (Lfter, physical inclusion).
Solution:

SYP Zusammenfassung

Markus Paller

Seite 14 von 16

Group
Problem:
We talk about a group, i.e. if animals belong to a herd (Rudel). Several individual objects (animals)
belong at a certain time slice to the same group object (herd).
Solution:

Test-Beispiele
Auf einer Palette sind mehrere Fsser. Paletten werden im Normalfall komplett geliefert und im
Normalfall komplett weiterverkauft. Es knnen jedoch auch einzelne Fsser verkauft werden. Lee-re
Paletten und einzelne Fsser knnen nicht vorkommen. Jede Palette hat eine Nummer.

Jedes Projekt hat genau einen Projektleiter, der fr mehrere Projekte verantwortlich sein kann. Die
meisten Programmierer arbeiten fr mehrere Projekte. Einige Programmierer sind gleichzeitig
Projektleiter eines anderen Projektes. Ein Programmierer kann aber nicht gleichzeitig Projektleiter
von ein und demselben Projekt sein.

Ein Verlage gibt ein Serie von Bchern heraus (Buchreihe), die zu einem bestimmten Thema gehren. Die Klassen sind mit mindestens 1 Attribut zu versehen.

SYP Zusammenfassung

Markus Paller

Seite 15 von 16

Test-Fragen
Give the characteristics of a Coordinator-Type pattern!

The associations are of simple type.


The coordinator class resolves a n-fold association into binary associations.
The coordinator class has association links to all other classes, generally to exactly one object
of each class.

Give the characteristics of a Group History-Type pattern!

An individual object is associated in course of time to different group of objects.


The history will be modeled in an associative class.
The restriction {t = k} specifies the cardinality at a certain time.
Since information during a period have to be registered associations cannot be removed,
whereas forth coming associations will be established.

What are the requirements of a History-Type pattern?

Since all his activities during his affiliation are important, they have to be maintained as long
as the employee belongs to the company.

SYP Zusammenfassung

Markus Paller

Seite 16 von 16

Das könnte Ihnen auch gefallen