I have a generic class and many classes that uses that generic
public abstract class BaseEntity<Entity> {
public int id;
public abstract Entity index();
}
example of two classes
public class ClassA extends BaseEntity<ClassA>{
public ClassA(int i) {
id = i;
}
@Override
public String toString() {
return "I am a ClassA, my id is " + id;
}
@Override
public ClassA index() {
return this;
}
}
and the other class
public class ClassB extends BaseEntity<ClassB>{
public ClassB(int i) {
id = i;
}
@Override
public String toString() {
return "I am a ClassB :D, my id is " + id;
}
@Override
public ClassB index() {
return this;
}
}
Now how would I go about representing this in uml? right now I put the BaseEntity
class as apstract, and added a small rectangle in top with dotted border and Entity
inside it. My problem is the line between ClassA
and BaseEntity
. I looked around and found people putting a dotted line with <bind Entity > ClassA>
. This seems logical to me but why is the line dotted as if it was an interface? wouldn't it be continuous?