Presentation is loading. Please wait.

Presentation is loading. Please wait.

UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams.

Similar presentations


Presentation on theme: "UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams."— Presentation transcript:

1 UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams

2 UML notations2 Background UML Unified Modeling Language (UML) is a standard language for specifying, visualizing, and constructing, and documenting the artifacts of software systems. – http://www.uml.org/ UML represents the collection of best engineering practices, mainly used for object oriented software development UML uses graphical notations to express the design of software projects.

3 Goals of UML Provide users with a ready-to-use visual modeling language to exchange meaningful models Provide extensibility and specialization mechanisms to extend the core concepts Be independent of particular programming languages and development processes. The development of UML began in 1994 by Grady Booch and Jim Rumbaugh from Rational Software Corporation

4 UML notations4 UML Diagrams Activity diagram – combined function/control view State diagram – highly interactive control Class diagram – static information structure (“data”) Use-case diagram – high level view of system services (functional)

5 UML notations5 Activity diagram Model control and information flow of a procedure or process It describes the state of activities by showing the sequence of activities performed.

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

7 UML notations7 Basic notation for activity diagram

8 UML notations8 Decision State transition is deterministic If transition depends on outcome of the work, then introduces a decision

9 UML notations9 Introducing concurrency

10 UML notations10 Swim lanes Process can sometimes be distributed over several agents or organizational units Notation: use compartments Use to model a business process (e.g. in organization model)

11 UML notations11 Notation for swim lanes

12 UML notations12 Object flow

13 UML notations13 Business process “Housing”

14 UML notations14 State diagrams Synonyms: “state chart”, “state-transition diagram” Purpose: model of dynamic behavior Use if control is heavily influenced by “external” events

15 UML notations15 State

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

17 UML notations17 Actions and activities Action: instantaneous, not interruptible – on transition – on state entry = action on all incoming transitions – on state exit = action on all outgoing transitions – on event Activity: takes time, interruptible

18 UML notations18 State diagram of ticket machine

19 UML notations19 State concurrency

20 UML notations20 State diagram “Housing”

21 UML notations21 Class diagram Describe the types of objects in a system and their relationships Model class structure and contents Class has three things: a name, attribute, and operations

22 UML notations22 Objects and classes

23 UML notations23 Object class Describes a group of objects with similar properties – Abbreviation: "class" Rationale for introducing classes: – 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.

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

25 UML notations25 Values and Value Sets 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: – string, number, integer, real, range, boolean, …. User-defined: – set or list of strings

26 UML notations26 Object Identifiers 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.

27 UML notations27 Operations Definition: – 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

28 UML notations28 Class notation

29 UML notations29 Associations Associations are used to link objects to other objects Majority of associations: – 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.

30 UML notations30 Association notation

31 UML notations31 Multiplicity examples

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

33 UML notations33 Association class 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.

34 UML notations34 Notation association class

35 UML notations35 Use of an association class

36 UML notations36 Associations with specific semantics 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: – generalization ("is a"). – aggregation ("part of").

37 UML notations37 Generalization Purpose: sharing similarities while preserving differences Is an association between a class that acts as super-class 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).

38 UML notations38 Notation for generalization

39 UML notations39 Aggregation 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 – precisely one; optional (0-1); many,...

40 UML notations40 Notation for aggregation

41 UML notations41 Composition Sub-type of aggregation Existence of part depends on aggregate

42 UML notations42 Aggregation and generalization Similarities: – Tree-like structure Differences: – AND-tree (aggregation) vs. OR-tree (generalization) – instance tree (aggregation) vs. class tree (generalization)

43 UML notations43 Combined aggregation and generalization

44 UML notations44 Use-case diagram shows services that can be expected from a system provides outsider view (customer) terminology use caseservice provided by system actoragent using a system service used in early phases of system analysis

45 UML notations45 Use cases for a library

46 UML notations46 A small case study 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

47 UML notations47 Use cases

48 UML notations48 Class diagram student student-card#: string name: string address: string date-of-birth: data major: Major......... course course-code: string year: integer trimester: 1-3 study-points: integer learning-goals: string description: text literature: text maximum-#students: integer exam date: date result: [0..10] enrollment date: date university staff member title: string position: string department: string telephone: string room: string e-mail: string 0+ course-exam 1 0+ tutor 0+ 1+ 0+ requires

49 UML notations49 Activity diagram for course enrollment procedure

50 UML notations50 State diagram: “update student data”

51 Tools to draw UML Powerpoint MS Visio: http://www.youtube.com/watch?v=FPB0Tw9j FE8 Online: – http://creately.com/Draw-UML-and-Class- Diagrams-Online http://creately.com/Draw-UML-and-Class- Diagrams-Online – http://www.gliffy.com/uses/uml-software/ http://www.gliffy.com/uses/uml-software/


Download ppt "UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams."

Similar presentations


Ads by Google