我寻求帮助,以便从此代码创建UML类图。
我根据自己的知识创建了一个UML类图,但天气是否正确,我不知道。
class driver {
public function __contruct() {}
public function theDriver($driveWhat) {
switch($driveWhat) {
case 1:
$newCar = new car();
$newCar->drive();
break;
case 2:
$newTruck = new truck();
$newTruck->drive();
break;
case 3:
$newBike = new bike();
$newBike->drive();
break;
}
}
}
class car{function drive(){...}}
class truck{function drive(){...}}
class bike{function drive(){...}}