You are on page 1of 9

OOP group assignment

Classes and their relationship


Department of software

Winta Ataklti ATE/3676/12

Yeabsira Mokonnen ATE/9596/12

Seyom lalaye ATE/2040/12

Submitted to= Mr. Michael sheleme


Submission date= 8/2/2022
Yabsira Getinet ATE/6009/12
UML Class Diagrams

Unified Modeling Language (UML) is modeling tool for software system or a visual modeling language
that describes various aspect of the software system the visual aspect helps in the comprehension of the
models. The second version of UML have two groups that consist 13 types. They are structure diagram
that model the static structure of the software system and behavior diagrams that model system
behavior or the behavior of software users.

UML class diagram is static structure diagram describes the structure of a system by showing the
system classes, their attributes, operations (or methods), and the relationships among objects. The class
diagram is the main building block of object-oriented modeling. Classes contain three compartments:
the top compartment contain the name of the class with bold and centered also the first letter is capital,
the middle compartment contains the attributes of the class, the bottom compartment contain the
operation (method) that the classes can execute. Both the middle and bottom are left-aligned and the
first letters are lowercases.

It is used for general conceptual modeling of the structure of the application, and for detailed
modeling translating the models into programming code. Class diagram can also be used for data
modeling and they are so general that they can be used in the modeling of system that use widely
different technologies, ranging from object- oriented programs to relational database. The classes in a
class diagram represent both main element, interaction in the application, and the classes to be
programed.

Class Relationship

A class relationship is general term that cover the specific type of logical connections found on class
and object diagram.

These are the graphical representation and names of relationship

Association

Classes relates to each other by associations that are graphically represented by line.
Bank Costumer

There is an association between class Bank and Costumer.

Specific association between class is presented by line with an arrow ( ).

Costumer Item

-i: int

+update()

The above example shows the more specifically with one way of navigation symbolized by an arrow.
Which means that class costumer has access to the public members of class item but not the other way
around.

Inheritance

Inheritance is denoted by an empty triangle that point from the more specific to the more general class.

Costumer

-name: string

-age: int

+update age()

Women Men

Realization/ Implementation
Realization relation is a relationship between two model elements, that one model element (the client
realizes or implements the behavior that the other model element (the supplier) specifies. In other word
the supplier is important for the client by providing the service.

Costumer Supplier

----------------------------

Dependency

This type of relationship shows the bond and the dependency of one class to other class, because it uses
it at some point.

The above relationship show that the car is dependent to is wheels not just use.

Aggregation

Aggregation relationship is more specific than association that represents a part of relationship between
classes. The class “has a” association. For instance a lecturer ‘has a’ class to teach. Aggregation may not
involve more than two classes.

Composition
Composition relationship is a type of relation that shows one class wouldn’t exist without the other. For
instance a child can’t exist without a parent or an order for a service can’t exist without a costumer.

Order Costumer

 The other important point on class relationship is Multiplicity. Multiplicity allows to set numerical
constraint on our relationship. It indicates that at least one of the two related classes make
reference to the other. The relations could be zero to one or optional(0….1), specific number (n),
zero to many (0….*), one to many (1….*), specific number range(m….N).

Student registration system

Classes Responsibility

User Uses the system to input data

Students Register for the for the course, take


course
professor Submits grade ,

Admin Access credentials,

Registrar Creates course, check admission


status and eligibility for the
registration, list course, handle user
authentication.
Course Took by the student

Results Marks of the student in a specific


course
Table: 1 Attribute Description for Student Class  Table: 2 Operation description for Student class

Visibility Return
Attribute Type Visibility Operation type
studentid String Private RegisterStudent() Private Boolean
First name String private Checkadmission() Private Boolean
Middle name String Private

Last name String Private

Department String Private

School String Private

Year String Private

Admission Boolean Private

GPA float Private

Table: 1 Attribute Description for users Class  Table: 2 Operation description for users class

Visibility Return
Attribute Type Visibility Operation type
Name int public authenticate() Private boolean
Password int Public Provideaccess( Private boolean
)
Email String Public

Contactno int public

Table: 1 Attribute Description for professor Class 

Attribute Type Visibility

staffID int public

Salary float Public

Department String Public


Table: 1 Attribute Description for admin Class 

Attribute Type Visibility

adname String Public

school String Public

Table: 1 Attribute Description for Course Class Table: 2 Operation description for course class

Attribute Type Visibility Visibility Return


Operation type
coursecode int Public
createcourse() Private String
title String Public
listcourse() Private list
startdate date Public

enddate date Public

Table: 1 Attribute Description for registrar Class 

Attribute Type Visibility

regname String Public

school String Public

Table: 1 Attribute Description for results Class Table: 2 Operation description for results class

Attribute Type Visibility Visibility Return


Operation type
coursecode int Public
submitgrade() Private String
studentname String Public
checkeligibility( Private boolean
proffesorname string Public
)
grade int Public

You might also like