In this section, we explain how to create a class in the system. Below is an example using PHP and image.
class Person
class Person {
public string $name;
public int $age;
public function speak():void
{
# code ...
}
public function walk(int $distance):void
{
# code ...
}
}
class Book
class Book {
public string $title;
public string $author;
public function borrow():bool
{
# code ...
}
public function return(int $distance):void
{
# code ...
}
}
( 1..1 ) One To One
( 1..* ) One To Many
( *..* ) Many To Many
( 0..1 ) Zero To One
( 0..* ) Zero To Many
Aggregation relation
Composition relation
Inheritance - Generalization relation
Dependency relation
Realization relation