UML Notations in Common KADS Activity diagrams State



















































![Class diagram exam date: date result: [0. . 10] requires 0+ course-exam 1 enrollment Class diagram exam date: date result: [0. . 10] requires 0+ course-exam 1 enrollment](https://slidetodoc.com/presentation_image/93a281ddef85e95a5e08c15e1b41a8bb/image-52.jpg)


- Slides: 54

UML Notations in Common. KADS Activity diagrams State diagrams Class diagrams Use-case diagrams UML notations

Background UML n n n Nineties: number of popular object-oriented methods Unified Modeling Language: proposal for set of standard notations wide attention ä n see www. rational. com mainly meant for analysis phase UML notations 2

UML notations used n Class diagram ä n Activity diagram ä n combined function/control view Use-case diagram ä n static information structure (“data”) high level view of system services (functional) State diagram ä UML notations highly interactive control 3

Activity diagram n n Model control and information flow of a procedure or process Useful if control is mainly synchronous ä n Use in Common. KADS: modeling the organizational process ä n otherwise: use state diagram worksheet OM-2 of the organization model Can also be used to model control flow within a task method (knowledge model) UML notations 4

Action state n State in which some work is being done ä n State terminates when the work is finished ä n difference with state diagrams After termination the action state can lead to another action state ä n activity, task “state transition” Special symbols for being and end of a procedure or process UML notations 5

Basic notation for activity diagram UML notations 6

Decision n n Sate transition is deterministic If transition depends on outcome of the work, then introduce a decision UML notations 7

Introducing concurrency UML notations 8

Swim lanes n n n Process can sometimes be distributed over several agents or organizational units Notation: use compartments In particular useful when modeling a business process (e. g. in organization model) UML notations 9

Notation for swim lanes UML notations 10

Object flow UML notations 11

Signals UML notations 12

Business process “Housing” UML notations 13

Activity diagram of method control UML notations 14

State diagrams n n n Synonyms: “state chart”, “state-transition diagram” Purpose: model of dynamic behavior Use if control is heavily influenced by “external” events Draw a state diagram for object classes with interesting behavior Activity diagram is alternative ä ä UML notations internal control object flow 15

State UML notations 16

State transition n Event: comes from outside the object modeled Message: generates event for another object Guard: outcome of internal object computation UML notations 17

Actions and activities n Action: instantaneous, not interruptible ä ä n on transition on state entry = action on all incoming transitions on state exit = action on all outgoing transitions on event Activity: takes time, interruptible UML notations 18

State diagram of ticket machine UML notations 19

State concurrency UML notations 20

State generalization n n If Object A is in super-state S, then the object us in precisely one of the sub-states Cf. concurrency: “and”-states UML notations 21

State diagrams in Common. KADS n n Communication modeling (Ch. 8) Asynchronous reasoning control ä n n real-time applications Control specification for the business process Overlap with activity diagrams ä UML notations state with no outgoing events = action state 22

State diagram “Housing” UML notations 23

Class diagram n Captures static information structure ä n n Generalization, inheritance & reuse are important issues Imported into Common. KADS domain- schema notation ä n In O-O: also functions no use made of operation box Can also be used in Task Model to sketch task information structure UML notations 24

Objects and classes UML notations 25

Object class n Describes a group of objects with similar properties ä n Rationale for introducing classes: ä n Abbreviation: "class" it provides a means for abstraction Terminology: “object” is often used in an ambiguous way, pointing to both objects (in the strict sense) and object classes. UML notations 26

Attributes n n An attribute describes a value held by objects belonging to the class. Attribute specification consists of: ä ä UML notations Class it is defined on (student) Attribute name (name) Admissible values (string) Optional: default value 27

Object and Value n n Most O-O approaches distinguish between objects and values. Difference: a value does not have an identity ä n n it "lives” only in connection to a certain object. RULE 1: an object is not allowed as a possible value of an attribute! RULE 2: attribute names need only to be unique within a class. UML notations 28

Values and Value Sets n n n Values are the primitive things with no internal structure from the viewpoint of the application Admissible values are defined through a value set Typical predefined value-sets: ä n string, number, integer, real, range, boolean, …. User-defined: ä UML notations set or list of strings 29

Object Identifiers n n n In O-O modeling you assume that every object has an identity. Consequence: introduce only attributes that act as identifiers, iff the identifier is something that exists in the real world. Examples: student card number, social security number. UML notations 30

Operations n Definition: ä n n n operation is "a function or a transformation that can be applied to objects of a class". Objects in a class share the same operations. Method: implementation of an operation = functional view UML notations 31

Class notation UML notations 32

Associations n n Associations are used to link objects to other objects Majority of associations: ä ä n n binary (between two objects) directional (should be read in a particular direction Ternary associations come up occasionally. Associations between more than three objects are rare. UML notations 33

Association notation UML notations 34

Multiplicity examples UML notations 35

Multiplicity n n n Also called: "cardinality". Always connected to one of the classes involved. Typical types of multiplicity: ä ä UML notations 0 -1 1 0+ 1+ Zero or one (optional). Precisely one. Zero or more, One or more. 36

Association class n n n Modeling an association as a class if the association has an internal information structure Advantage: associations become first-class objects. Attributes and methods can be defined for the association class. UML notations 37

Notation association class UML notations 38

Use of an association class UML notations 39

Associations with specific semantics n n n Associations provide a general, "neutral", way of connecting object classes. Semantics of the association are defined through argument typing, multiplicity and (implicitly) the name of the association. Class diagrams provide specific types of associations, with predefined semantics: ä ä UML notations generalization ("is a"). aggregation ("part of"). 40

Generalization n n Purpose: sharing similarities while preserving differences Is an association between a class that acts as superclass and one or more classes called the sub-classes. Super-classes show the features that the sub-classes have in common. Each sub-class inherits the attributes and operations defined on its super-class(es). UML notations 41

Notation for generalization UML notations 42

Aggregation n Aggregation denotes a binary association in which one side is an "assembly" and the other side a "part". "Assembly" and "part" act as predefined roles involved in the aggregation association. Cardinality of a part can be defined ä UML notations precisely one; optional (0 -1); many, . . . 43

Notation for aggregation UML notations 44

Composition n n Sub-type of aggregation Existence of part depends on aggregate UML notations 45

Aggregation and generalization n Similarities: ä ä n Tree-like structure Transitive properties Differences: ä ä UML notations AND-tree (aggregation) vs. OR-tree (generalization) instance tree (aggregation) vs. class tree (generalization) 46

Combined aggregation and generalization UML notations 47

Use-case diagram n n n shows services that can be expected from a system provides outsider view (customer) terminology use case actor n n service provided by system agent using a system service used in early phases of system analysis use in Common. KADS: way to present possible solutions to customer UML notations 48

Use cases for a library UML notations 49

A small case study n n n Course administration system (CAS) Context: university department Required services: STUDENT: update personal data, inspect exam results, inspect course info, enroll in course TUTOR: inspect exam results, update course info, inspect enrollments ADMIN STAFF: enter exam results, inspect exam results, update personal data students, inspect enrollments UML notations 50

Use cases UML notations 51
![Class diagram exam date date result 0 10 requires 0 courseexam 1 enrollment Class diagram exam date: date result: [0. . 10] requires 0+ course-exam 1 enrollment](https://slidetodoc.com/presentation_image/93a281ddef85e95a5e08c15e1b41a8bb/image-52.jpg)
Class diagram exam date: date result: [0. . 10] requires 0+ course-exam 1 enrollment student-card#: string name: string address: string date-of-birth: data major: Major. . 0+ date: date 0+ course-code: string year: integer trimester: 1 -3 study-points: integer learning-goals: string description: text literature: text maximum-#students: integer 0+ university staff member title: string 1+ position: string department: string telephone: string room: string e-mail: string UML notations tutor 52

Activity diagram for course enrollment procedure UML notations 53

State diagram: “update student data” UML notations 54