0

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.

ProgrammersBlock
  • 5,974
  • 4
  • 17
  • 21
jundo
  • 66
  • 1
  • 10
  • 1
    _I'll edit it after you response_ No. This is not an incremental tutorial place. State your question and do not change it upon any answer. – qwerty_so Feb 26 '17 at 16:49

2 Answers2

2

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

ProgrammersBlock
  • 5,974
  • 4
  • 17
  • 21
  • That generally looks ok. But parts of the question (esp. which you cite) are more for reading the tea leaves. So you better should have asked for clarification first. – qwerty_so Feb 26 '17 at 16:52
  • İf the main is that is there Composition ? `public class main{ public static void main(String[] args) { Login login = new Login(); } }` – jundo Feb 26 '17 at 17:49
  • this is exactly what i saw in my inner vision! possibly add members to f in the form of a-objects named something along the lines of method1Command :) – davogotland Feb 26 '17 at 19:19
  • With regards to the composition, to me it is mostly a style thing that I use because that was the convention used in class. I have no strong feelings about whether it has to be there or the difference between white diamond and black diamond. – ProgrammersBlock Feb 26 '17 at 19:31
0

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

granier
  • 1,739
  • 13
  • 25