Author Topic: Automatic method addition  (Read 3529 times)

neuron

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Automatic method addition
« on: March 19, 2008, 06:46:30 pm »
Has EA feature like this ? ->

When I create method m() in sequence diagram, m() method will be automaticaly added to class Class2

A: Class1  B: Class2
--             --
|      m()    |
|   -------> |
|               |

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: Automatic method addition
« Reply #1 on: March 19, 2008, 08:32:26 pm »
When you trace a message from:

Object1:Class1  ----> Object2:Class2

...in the message properties window, exists a button called "Operations..." that gives you to the parent class operations window, where you can create the method.

When method is created, you can select it from the combobox of the message window.

shimon

  • EA User
  • **
  • Posts: 125
  • Karma: +5/-0
    • View Profile
Re: Automatic method addition
« Reply #2 on: December 06, 2024, 01:30:20 am »
Hi,
As this seems to be deprecated in version 15.2 ( I think it got dropped in version 12), did anyone make a simple script to add the operation to the receiving Class?
Shimon

shimon

  • EA User
  • **
  • Posts: 125
  • Karma: +5/-0
    • View Profile
Re: Automatic method addition
« Reply #3 on: December 23, 2024, 05:20:33 pm »
Hi,
As the saying (Pirkey Avot) goes:
If I am not (there) for myself, who is there?
And when I am all to myself, what am I?
And if not now ( i.e. if you don't get around to it now) , then when?

I started writing a script that adds an operation to the receiving class on a sequence diagram, based on the message chosen. I might extend it to run through an entire diagram.

I just wrote the outline of checks that I do, to verify that I have the right kind of connector, and that it is not already an operation. I now added the operation with the notes of the message, but even after adding a tagged value to the message, when I rename the operation, the message does not get renamed.
This means that you have to manually change the message to the operation that you just created. This is not the most elegant solution.
I'll try to share this script.
Sincerely,
Shimon
P.S. Meanwhile this works only on Classes, not Objects (instances).

« Last Edit: December 24, 2024, 03:28:51 am by shimon »