Drawing described UML diagram with inheritance

1.8k Views Asked by At

I have some objects that I want to draw a UML diagram for. The first, A, is an interface, and second, B, is an abstract class which is derived from A. The other class are C and D. C and D are subclasses of B.

B has a list of E class objects.

F is a class which all operations are performed in it. C and D class objects creates in the class according to polimorphism operations and then calls its methods according to users input.

Of course, there is a main class. The main class only creates F class object.

I want to draw a UML class diagram. What should the image be like? How can I draw F class ?

The uml class diagram which is writen by my is here.

By the way I know that's the very basic image, I'll edit it after you response.

2

There are 2 best solutions below

4
ProgrammersBlock On

Based on your description, this is what I think the UML diagram would look like.

For this statement "F is a class which all operations are performed in it. C and D class objects creates in the class according to polimorphism operations and then calls its methods according to users input." It sounds like you would need to make a relationship between A and F because you are talking about polymorphism. A should have methods. B and C could have those same methods. F doesn't need a relationship to B or C because the relationship to A implies there is a class implementing A but the concrete class name is irrelevant.

UML Diagram

0
granier On

Since I can not add a comment. I would suggest two points: - Maybe the aggregation could be changed in composition if Main class gets an attribute of type F, otherwise a dependency would modelize better the relation between Main and F.

  • It would be more precise if a cardinality were defined on B side in the relation between B and E.

Hoppe this help to improve the good answer of ProgrammersBlock