Book a Demo

Author Topic: show C++ method calls in an object diagram  (Read 22946 times)

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
show C++ method calls in an object diagram
« on: December 04, 2020, 08:49:00 pm »
Hi,
How can I use concrete methods of a C++ class as interactions between class instances in an object diagram?
I parse my C++ source code and get a model tree. Next I create an object diagram and drag'n'drop classes to it (by creating objects). Which connections between such C++ class instances should I use to illustrate C++ class method calls? How can I select those methods from a list of methods of such parsed class?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #1 on: December 04, 2020, 09:19:07 pm »
An object diagram is not for showing behavior but structure. Use an AD or SD instead.

q.

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #2 on: December 04, 2020, 09:30:11 pm »
An object diagram is not for showing behavior but structure. Use an AD or SD instead.

q.
No, what I want is to show a structure survey of how important chains of method calls are wired. The time is not of interest

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #3 on: December 04, 2020, 09:43:58 pm »
An object diagram is not for showing behavior but structure. Use an AD or SD instead.

q.
I tried an activity diagram and dragged 2 parsed C++ classes (which have many parsed C++ methods) as instances (= objects) from model tree to diagram. Then I try to connected these objects but there is no list of C++ methods of the class which I can use to select as name. I tried Control Flow arrows and Usage arrows. But it seems there is no way to use the parsed class members and methods. How can I use what I have parsed from the C++ code? This is essential for me as C++ programmer.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #4 on: December 04, 2020, 10:38:56 pm »
An object diagram is not for showing behavior but structure. Use an AD or SD instead.

q.
No, what I want is to show a structure survey of how important chains of method calls are wired. The time is not of interest
That's a behavioral aspect, not a structural one.

q.

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #5 on: December 04, 2020, 10:45:39 pm »
An object diagram is not for showing behavior but structure. Use an AD or SD instead.

q.
No, what I want is to show a structure survey of how important chains of method calls are wired. The time is not of interest
That's a behavioral aspect, not a structural one.

q.
No, the blocks in an activity diagram are actually the method calls of a C++ class, and the arrows are the running time from call to call, the timeline so to speak. There are no class instances in such diagram type. Arrows in activity diagrams bring a time order to all the activities, and the C++ method calls are activities. This is not what I want to show.

So I want to show the program C++ class instances (=objects) (which are blocks) and their wired method calls (which are arrows). That is why I need to take a structural diagram, which is an object diagram.
« Last Edit: December 04, 2020, 10:57:26 pm by F@lk »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: show C++ method calls in an object diagram
« Reply #6 on: December 04, 2020, 11:26:26 pm »
I guess you are looking for a Communication Diagram

An alternative (used much more) is the Sequence diagram

Geert

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #7 on: December 05, 2020, 12:22:53 am »
I guess you are looking for a Communication Diagram

An alternative (used much more) is the Sequence diagram

Geert
Yes, a communication diagram makes sense to show the wired structure of the C++ program. But as I tried I saw there is no possibility either to choose one of the parsed C++ class methods as names for the accociations between class instances in such diagram. How can I use what I have parsed?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: show C++ method calls in an object diagram
« Reply #8 on: December 05, 2020, 01:50:30 am »
In a communications or sequence diagram you should be able to select an existing operation.

See here: https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/createacommmessage.html

Geert

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #9 on: December 05, 2020, 02:01:03 am »
In a communications or sequence diagram you should be able to select an existing operation.

See here: https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/createacommmessage.html

Geert
It's only possible in sequence diagrams.  :'(

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: show C++ method calls in an object diagram
« Reply #10 on: December 05, 2020, 02:16:33 am »
In a communications or sequence diagram you should be able to select an existing operation.

See here: https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/createacommmessage.html

Geert
It's only possible in sequence diagrams.  :'(
No it isn't. I just tested it on a communication diagram using these instructions.

Geert

F@lk

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: show C++ method calls in an object diagram
« Reply #11 on: December 07, 2020, 08:02:45 pm »
No it isn't. I just tested it on a communication diagram using these instructions.

Geert
Yes, you're right. It's with RMB-click and choose "message" there. Thanx