Book a Demo

Author Topic: Operations and Actions  (Read 4378 times)

Tiger

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Operations and Actions
« on: June 20, 2017, 07:36:26 pm »
I am trying to achieve 2 things:
Firstly, I would like to create a reference library of Operations that can be applied to classes that have a common behaviour.  For example, we are modelling a number of Applications that have a common Operation (Application Function) "Display Report".  In order to ensure consistency, I would rather have a pick list that the Analysts can chose from, than let them create lots of different Operations (eg 'Display Reports', Display Rpt etc) that are all essentially the same thing.
Secondly, I know I can drag an Operation onto a pallet and it creates an Action. I know I can link it to the Operation but there doesn't seem to be a way to ensure changing the name in one changes it in the other. Is there a way that an Action (in this case an Application Function) can be assigned to an Application as an Operation?
Any help would be appreciated as we are currently having to do this as a mandrolic exercise in Sparx.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Operations and Actions
« Reply #1 on: June 20, 2017, 07:50:58 pm »
The operations can probably be stereotyped and put into an MDG to make the uniquely accessible for modelers.

When you drag an operation onto an AD you get a call invocation. Though the name of this will not change when the operation is renamed, the link to he operation is preserved in the Behavior property. You could run a script to rename the call actions if you so wish.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Operations and Actions
« Reply #2 on: June 20, 2017, 09:04:44 pm »
You could run write a script to rename the call actions if you so wish.
FTFY. :)
The point is that there's no such script available out of the box.

As to Tiger's first question, why not simply use an interface which the applications (presumably components or classes) realize?

When you draw the realization connector, you get the option of overriding the operations in the realizing component/class. Overriding creates local copies of operations in the component/class as if you had created them manually -- but note that subsequent changes to the interface (eg renaming an operation) have no bearing on the components/classes: the copied operations are copies, not references to the original.

You can of course also work with abstract classes which you specialize. In this case, the operations in the specialized class/component is not a copy but a reference to the operation in the abstract class, so changes to the operation in the abstract class are immediately visible in the specialized elements.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Operations and Actions
« Reply #3 on: June 20, 2017, 09:56:53 pm »
To be picky: just writing the script is probably not enough xD

q.