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.

1
  • 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. Commented Feb 26, 2017 at 16:49

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

4 Comments

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.
İf the main is that is there Composition ? public class main{ public static void main(String[] args) { Login login = new Login(); } }
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 :)
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.
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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.