0% found this document useful (0 votes)
19 views24 pages

Deel 8 UML Fragment C

1. The document discusses additional concepts and conventions for a UML class diagram lecture. 2. Association classes are not to be used, and implementation-specific get/set operations and multiple inheritance should be avoided. 3. Signatures should include parameter lists and return types, and visibility and navigation concepts should not be modeled.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views24 pages

Deel 8 UML Fragment C

1. The document discusses additional concepts and conventions for a UML class diagram lecture. 2. Association classes are not to be used, and implementation-specific get/set operations and multiple inheritance should be avoided. 3. Signatures should include parameter lists and return types, and visibility and navigation concepts should not be modeled.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Additional language concepts and

conventions for this lecture


Additional language concepts:
Association classes (1/2)

Company Person
employs
0..* 0..*

EmploymentContract
Association class
annualSalary : Money
dateOfRecruitment : Date Association attributes

How can the described aspects be represented without


the language concept of an “association class”?

69
Additional language concepts:
Association classes (2/2)

EmploymentContract
Company Person
issues annualSalary : Money has
1..1 0..* dateOfRecruitment : Date 0..* 1..1

Note: For all assignments in this course, this


‘resolved association class’ approach is to be used!

70
Additional conventions for this lecture

1. The concept of an association class is not to be used.

71
Additional conventions for this lecture

1. The concept of an association class is not to be used.

2. Do not model implementation-specific get and set


operations.

Vehicle
name : String
weight : Decimal Vehicle
initialRegistration: Date
name : String
setName()(name: String) weight : Decimal
setWeight()(weight: Decimal) initialRegistration : Date
getName() : String calculateAge(): Integer
getWeight() : Decimal
calculateAge(): Integer

72
Additional conventions for this lecture

1. The concept of an association class is not to be used.

2. Do not model implementation-specific get and set


operations.

3. Provide signatures with a parameter list (input


parameters) and a return type (if applicable).

73
Additional language concepts:
Generalisation/specialisation—multiple
inheritance
Employee
firstName : String
lastName : String
dateOfBirth : Date

StudentAssistant ResearchAssociate
staffID : String staffID : Integer
matriculationNumber : Integer dateOfRecruitment : Date
dateOfMatriculation : Date maritalStatus : Char
getSemester() : Integer

DoctoralStudent
desiredDegree : Doctorate
qualifyingDegree : StudyProgramme

Which problem do you expect here?

74
Additional conventions for this lecture

1. The concept of an association class is not to be used.

2. Do not model implementation-specific get and set


operations.

3. Provide signatures with a parameter list (of input


parameters) and a return type (if applicable).

4. Do not use the concept of multiple inheritance.

75
Additional language concepts:
Abstract class

 Abstract class: An abstract class cannot be instantiated

 Primarily aimed at exploiting potentials for reuse through


generalisation/specialisation

 Notation: Either class name in italics, or specifier <<abstract>>


above class name

<<abstract>>
Class Class

76
Additional language concepts: Visibility
(1/3)

Source: www.ibm.com/developerWorks

77
Additional language concepts: Visibility
(2/3)
 UML class diagrams offer various additional language
concepts for defining implementation-level aspects to
support the software design/implementation phase

 Visibility: Allows to specify to which extent external objects


may access (read and/or write) class attributes and call
operations

 UML defines 4 levels of visibility:


▪ -private: only accessible in the class
▪ ~package: only accessible within the package
▪ #protected: accessible to classes in package and subclasses
outside package
▪ +public: always accessible

 Notation: Adding a prefix before the name

78
Additional language concepts: Visibility
(3/3)

Customer
+name : String
-address : String
#dateOfBirth : Date
+getName() : String
+setName (name: String)
+getAddress () : String
+setAddress (address: String)
Visibility +getDateOfBirth () : Date
+setDateOfBirth(dob: Date)

79
Additional language concepts:
Navigation (bidirectional vs. unidirectional
association)
 Navigation: Specifies where (i.e., in objects of which
classes) references to objects of associated classes should
be stored

 Default navigation specification: Bidirectional

Employee
Company
employs name : String
name : String
annualSalary : Money
legalForm : String
1..1 0..* dateOfRecruitment : Date
numberOfEmployees() : Integer

Direction of navigation
Employee Employee
Company Company
name : String employs name : String
name : String employs name : String
annualSalary : Money annualSalary : Money
legalForm : String legalForm : String
1..1 0..* dateOfRecruitment : Date 1..1 0..* dateOfRecruitment : Date
numberOfEmployees() : Integer numberOfEmployees() : Integer

Numerous further language concepts to support implementation-


level aspects of software systems (e.g., interfaces)
80
Additional conventions for this lecture

1. The concept of an association class is not to be used.

2. Do not model implementation-specific get and set


operations.

3. Provide signatures with a parameter list (of input


parameters) and a return type (if applicable).

4. Do not use the concept of multiple inheritance.

5. Do not use visibility and navigation concepts.

81
Core concepts of object-orientation:
Consideration in the UML Class Diagram
modelling language (1/4)

1. Class: Abstracting from particular instances and from the


concrete implementation

Student
matriculationNumber : Integer
dateOfMatriculation : Date
getSemester( date : Date ) : Integer

Core concept of the UML Class Diagram modelling language

82
Core concepts of object-orientation:
Consideration in the UML Class Diagram
modelling language (2/4)

1. Class: Abstracting from particular instances and from the


concrete implementation

2. Encapsulation: Abstracting from the internal data


structure and the concrete implementation of operations

Customer
+name : String
-address : String
#dateOfBirth : Date
+getName() : String
+setName(name:String)
+getAddress() : String
+setAddress(address:String)
Visibility +getDateOfBirth() : Date
+setDateOfBirth(dob:Date)

83
Core concepts of object-orientation:
Consideration in the UML Class Diagram
modelling language (2/4)

1. Class: Abstracting from particular instances and from the


concrete implementation

2. Encapsulation: Abstracting from the internal data


structure and the concrete implementation of operations
Customer
Principle of information hiding: External access to attributes not
+name : String
allowed; access only by sending a :message
-address String to an object to call a
corresponding operation. #dateOfBirth : Date
+getName() : String
+setName(name:String)
+getAddress() : String
+setAddress(address:String)
In conceptual models for
analysis
Visibility purposes,
+getDateOfBirth() : Date it
is usually abstracted
from visibility issues to focus on domain issues.
+setDateOfBirth(dob:Date)

However: The visibility language concepts of the UML Class Diagram


modelling language allow to violate the concept of encapsulation.
84
Core concepts of object-orientation:
Consideration in the UML Class Diagram
modelling language (3/4)
1. Class: Abstracting from particular instances and from the
concrete implementation

2. Encapsulation: Abstracting from the internal data


structure and the concrete implementation of operations

3. Generalisation/specialisation (inheritance): Abstracting


from the particularities of specialised classes
Person
firstName : String
lastName : String
dateOfBirth : Date
age() : Integer

Student Professor
matriculationNumber : Integer staffID : Integer
dateOfMatriculation : Date dateOfRecruitment : Date
getSemester() : Integer

Core concept of the UML Class Diagram modelling language


85
Core concepts of object-orientation:
Consideration in the UML Class Diagram
modelling language (4/4)

3. Generalisation/specialisation (inheritance): Abstracting


from the particularities of specialised classes

4. Polymorphism: Abstracting from the receiver of a message


Employee
firstName : String
lastName : String
dateOfBirth : Date
calculateChristmasBonus() : Decimal

StudentAssistant ResearchAssociate
matriculationNumber : Integer staffID : Integer
dateOfMatriculation : Date dateOfRecruitment : Date
getSemester() : Integer calculateChristmasBonus() : Decimal
calculateChristmasBonus() : Decimal

86
Assessment
Assessment: UML

 (Almost) unrivalled in commercial software development

 Numerous language concepts and diagram types

 Supported by plenty of modelling tools

 Intense, though often critical reception in academia

 Language specification sometimes ambiguous and


underspecified

88
Exam preparation questions (1/2)

1. Name and describe the core language concepts of UML


class diagrams.

2. Describe the foundational idea of the UML in your own


words.

3. Elaborate on the differences between data models and


object models.

4. Discuss the commonalities and differences between ERM


und UML Class Diagrams.

89
Exam preparation questions (2/2)

5. Explain the semantic and syntactical differences between


the language concepts of association, aggregation, and
composition.

6. Explain the intensional and the extensional notion of a


class.

7. Explain how, and with which modelling concepts the four


core concepts of object orientation are addressed by the
UML Class Diagram modelling language.

8. Provide a critical assessment of the UML Class Diagram


modelling language in the light of the core concepts of
object orientation as presented in the lecture.

90
Literature

Booch, Grady, et al. (2005): The Unified Modeling Language


User Guide. Addison-Wesley, Upper Saddle River (available in
the UU Library)

Frank, U. (2010): The MEMO Meta Modelling Language (MML)


and Language Architecture. ICB-Research Report Nr. 24,
Universität Duisburg-Essen, pp. 7-13.
https://doi.org/10.17185/duepublico/47113

91

You might also like