简体   繁体   中英

What diagram I should use to represent interaction between functions in modules?

I need to create a diagram using UML or SysML notation. I've got modules, that consists of functions. Some functions are used only “inside” the module, others are used by other modules.

Example:

MODULE 1 has two functions: func1 and func2 . func2 uses func1 :

int func1 (int p1, int p2)
{
   d=func1();
   return noerr;
}

int func2 (int p3, int p4)
{
    if (p4>0 || func1(p1,p2))
    {
        // warning
    }
    else
    {
        return noerr;
    }
}

MODULE 2 has one function, func3 . It uses func1 from MODULE 1 :

int func3 (int p5, int p6)
{
    if (p5<0 || func1(p1,p2))
    {
        // warning
    }
    else
    {
        return noerr;
    }
}

I need to show graphically interaction between func1 and func2 inside MODULE 1 and interaction between MODULE 1 and MODULE 2 with use of func1 . I'll appreciate any help and samples.

In UML, I would regard the modules as classes and the functions as operations of these classes, as in the following class diagram :

D类

The dependencies at the function level and the interaction between the modules can be depicted using sequence diagrams as follows:

SEQ1

SEQ2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM