Hi, I draw two class Person,Car and put an 1…* association between them,called drive, which means a person can drive multiple cars. In the generating java dialog window, I found the generated collection type of cars can’t be assigned, just array,ArrayList,Vector etc, you know, normally we use super class of Collection , such as List,Map,Set, not concrete class such as ArrayList,HashMap for refactoring .
below is generated code by vp for uml 7.0
Car.java
public class Car {
private int speed;
Person driver;
public void setSpeed(int speed) {
this.speed = speed;
}
public int getSpeed() {
return this.speed;
}
}
Person.java:
import java.util.ArrayList;
public class Person {
private int age;
ArrayList<Car> car = new ArrayList<Car>();//I do hope the type would be List<Car> , that said List<Car> car = new ArrayList<Car>();
}
thanks , vp is a good uml , I think so after try many uml tool.