-1

Overall Class Diagram I drew class diagram in android Studio. First picture is my class diagram. I have a question about it.

this is the problem

this is the problem

Definitely, I used method of UserMemoryParse class in project_Utils class. But any relationship between two classes is not defined in class diagram.

Code

Code

This is my code related with aforementioned situation

Obviously two class have relationship ..... But why any relationship line can not be found in class diagram?

(+ and some line is thin while some line is thick (both of are association of relationship) what is the differences between that)

`        


[1.Project_Utils class]
    private void parseData()
    {
        mSequencEvent.onUtilUpdateStatus(IOnSequence.STATUS.PARSE);
        mapParseData.clear();
        List userList = new ArrayList(mapUserData.keySet());

        for(int i=0; i<5; i++) {
           String userData = userList.get(i).toString();
           String a = mapUserData.get(userData);
               String parseData = UserMemoryParse.pasingData(a,userData);
               if (mSequencEvent != null)
                   mSequencEvent.onUtilUReceivedParseData(parseData);

        }
    }



[2.UserMemoryParse Class]

 public static String pasingData(String a, String userMemory) {
        String parseData = "Error";
        try {
            //HEX to binary
            String binaryUserData = new BigInteger(userMemory, 16).toString(2);

}

`

DoaOh
  • 1
  • 2
  • [Why not upload images of code on SO when asking a question?](https://meta.stackoverflow.com/q/285551/5221149) – Andreas Mar 26 '20 at 04:50
  • *"But any relationship between two classes is not defined in class diagram"* : ask yourself what kind of relation there are, they do not support an inheritance nor an attribute etc, so in a class diagram if you really want to represent them you can use a dependency. Of course there are not only class and class diagrams in UML, you also have the interactions (shown through sequence diagram etc), composite diagrams, the components and activities with corresponding diagrams etc – bruno Mar 26 '20 at 07:22

2 Answers2

0

Using an operation from another class is a behavioral feature, not a static one. UML class (diagram) generators in general only look at the static part of classes (which is in most languages what uses to be in header files) and they do not parse the actual code. If any such condition is present you would need to manually add a dependency between both classes. Using a tool does not mean it is a) correct (using shared aggregation is strange in first place and on self it looks just absurd) or b) will create something you may find pleasing. In any case you need a manual re-work. Here: draw the dependency manually.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
-1

A class diagram doesn't care about using static functions in other classes. Relationships that such a diagram would indicate are, for instance, inheritance or aggregation. These are structural traits of a system. The internals of methods are completely irrelevant to that diagram.

Robb
  • 139
  • 4
  • the fact there are static or not is not relevant – bruno Mar 26 '20 at 07:24
  • I encourage you to correct/improve your answer (the DV is not from me) – bruno Mar 26 '20 at 08:08
  • I was talking about internal usage of static methods in other classes, since this is neither an aggregatory nor an inherited relationship. This does not belong in a class diagram. – Robb Mar 27 '20 at 08:08
  • again the fact there are static is not relevant, it is exactly the same thing with non static – bruno Mar 27 '20 at 11:23
  • And again (!) I know that. What I said still holds true. That it's not about internals of methods. Were those calls not static, though, that would imply that maybe yet there is an aggregatory relationship somewhere, since it must have a concrete instance of another class. – Robb Mar 28 '20 at 18:11
  • sincerely, when one reads *A class diagram doesn't care about using static functions in other classes* because you reduce the scope to the *static* we understand this is only true for them, and not for non static. Just my 2 cents ;-) – bruno Mar 28 '20 at 18:16