0% found this document useful (0 votes)
2 views

Software Engineering Lab10

The document outlines a lab exercise on requirements modeling using object and class diagrams for a software engineering course. It discusses the creation of UML diagrams to represent relationships between students, courses, and university structures, emphasizing the importance of classes and their attributes. Additionally, it explains the generalization and relationships between classes within a university information system.

Uploaded by

cikif83366
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)
2 views

Software Engineering Lab10

The document outlines a lab exercise on requirements modeling using object and class diagrams for a software engineering course. It discusses the creation of UML diagrams to represent relationships between students, courses, and university structures, emphasizing the importance of classes and their attributes. Additionally, it explains the generalization and relationships between classes within a university information system.

Uploaded by

cikif83366
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/ 13

KARABUK UNIVERSITY

Computer Engineering Department

CPE 310 Software Engineering


Lab#10
Requirements Modeling
Object & Class Diagrams

Hasan Kivrak
TEKNOFEST 2021 Competitions
● PRELIMINARY DESIGN REPORT (PDR)
○ Task Requirements

○ Requirements should be established to cover all of


the issues determined within the scope of the task
in the competitor's specification.
UML Diagrams

Covered
This Week
Next Steps
Object diagram
● Allow you to depict concrete objects and their
relationships(links) that appear in a system

● contains three student objects:


○ helenLewis, mikeFox, and paulSchubert
○ also know the date of birth and matriculation
number for each of these object

● contains the three courses


○ oom (Object-Oriented Modeling),
○ iprog (Introduction toProgramming)
○ db (Databases)

● The course iprog takes place in lecture hall lh1


● the course db takes place in lecture hall lh2.
● There is no corresponding information for oom.

● Student helenLewis attends the two courses oom and


iprog.
● Student mikeFox also attends iprog;
● Course db is attended only by student paulSchubert
From object to class
● Many individuals that appear in a system have identical
characteristics and behavior.
○ For example, persons always have a first name, a last name, and a date of birth.
Students also have a matriculation number.
○ Courses always have a name and a number of hours, as well as a semester in which
they take place. Information about the lecture halls

● If every person, every course, and every lecture hall of the system were
to be modeled individually, the model would soon become
over-complicated and impossible to maintain.
● Using classes enables you to describe similar objects without having
to detail each and every object individually.
Classes
● A class is the construction plan for a set of similar objects that appear in the system to be specified.

● Classes can characterize


○ persons (e.g., students)
○ events (e.g., courses or exams), or even abstract concepts such as groups.

● Attributes and behaviors

● Objects represent the concrete forms of classes and are referred to as their instances.

● In object-oriented programming languages like Java, programs are created based on classes.
Class diagram
● Class diagrams are the most common diagrams used in UML.
● Represent the object-oriented view of a system, hence generally used for
development purpose
● Based primarily on the concepts of
○ class, generalization, and associations

● You can model the classes:


○ Course, Student, and Professor occur in a system.
○ Professors teach courses and students attend courses.
○ Students and professors have common properties
■ They are both members of the class Person.
■ This is expressed by a generalization relationship
Information system of a university
● A university consists of multiple faculties which are composed of university
various institutes. Each faculty and each institute has a name. An address is
known for each institute.
● Each faculty is led by a dean, who is an employee of the university.
● The total number of employees is known. Employees have a social security
number, a name, and an e-mail address. There is a distinction between research
and administrative personnel.
● Research associates are assigned to at least one institute. The field of study of
each research associate is known. Furthermore, research associates can be
involved in projects, and the name, starting date, and end date of the projects
are known. Some research associates teach courses. They are called lecturers.
● Courses have a unique number (ID), a name, and a weekly duration in hours.
Identifying the classes
● As we can see, University is not a
separate class.
● We are using the class diagram to
describe the system University
● Hence the instance of our model
contains those objects that occur
within a university,
Identifying the attributes
● describe our classes in more detail
using attributes
○ name

○ meaningful data types

○ visibility

○ Instance or class variable


Identifying the relationships between classes
● Classes can be linked with one another in three ways.
○ Generalization (sub-/superclass relationship)

○ Aggregation

○ Associations
Generalizations
● The following sentences strongly indicate a
generalization relationship:
○ “There is a distinction between research and
administrative personnel.”

○ “Some research associates teach courses. Then


they are called lecturers.”

● As every employee of a university belongs to either the


research or administrative personnel, we can set the
class Employee to abstract
Complete class diagram of the information
system of a university
● The classes Lecturer and Course are linked by
means of the association teaches.
● An employee (dean) leads the faculty.
● A faculty consists of multiple institutes.
○ existence dependency modelled with a
composition (strong aggregation)
● Research associates are assigned to an
institute, meaning they are part of an institute
○ Shared aggregation is possible in order
to represent the parts-whole relationship
explicitly
● Finally, we have the involvement of research
associates in projects

You might also like