Book a Demo

Author Topic: Method Parameter Tracing  (Read 3605 times)

bomber

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Method Parameter Tracing
« on: January 06, 2005, 03:55:53 am »
Tracing method parameters through deep call stack.

This is not really a UML or EA related question, but a general design question.
In the process of designing objects with methods that will implement some functionality, it is sometimes
necessary to change the parameters of the various methods. I realise that one should fix the interfaces,
but with a large system it is sometimes required.

When the set of objects and methods starts to get large and the method parameters change, I find it hard
to 'track or manage' the parameter integrity of the method call stack. For example I have a method that
has to call some methods in other objects to obtain values as well as internally calculate values. These
values are then used as input parameters to other methods that this method calls. This argument holds for
any level of the call stack. When I review a portion of the call stack, I need to make sure that I have
all the necessary values for the various input parameters of the methods I call at each level.

Now, a scenario diagram can show me this, but it gets very cluttered to the point of being unasable
especially if there are many parameters to the methods.

I would appreciate any tips or maybe their is merit in adding a diagram to EA purely for the purposes
of tracing parameters through a method call stack as extracted from the various scenario diagrams and
class definitions. It could look like this (COPY & PASTE INTO NOTEPAD TO USE FIXED WIDTH FONT FOR THIS PART - SORRY COULD NOT GET THIS TO LINE UP):



Obj.Method1   Obj.Method2   Obj.Method3
   |               |             |
----X               |             |
   |               |             |
   |---------------X             |
   |               |             |
   |               |-------------X
   |               |             |
   |               |             |




where the diagram looks like a scenario diagram and the X is the collapsed parameter list. When we
expand the parameter lists it would look like this:

ObjMethod1     ObjMethod2   ObjMethod3
   |               |           |
----> P1            |           |
   > P2            |           |
   > P3            |           |
   |               |           |
   |---------------> P1        |
   |               > P4        |
   |               |           |
   |               |-----------> P2
   |               |           > P4
   |               |           > P5
   |               |           |


This diagram will now tell me:
- What parameters ObjMethod1 expects
- P1 is passed through to the call to ObjMethod2
- ObjMethod2 requires P4 which ObjMethod1 has to get somewhere or calculate
- ObjMethod3 expects P2 which is passed to ObjMethod1, but may need to be passed through ObjMethod2
- ObjMethod3 requires P5 which ObjMethod2 has to get somewhere or calculate

etc....

I suppose one could do this with the AI or write an add-in....







Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Method Parameter Tracing
« Reply #1 on: January 08, 2005, 11:31:00 pm »
It is a very intersting question, since tracking of a parameter through stack is a dynamic scenario.

one option is to name all places where parameter can pass through with the same name. it is just a bad work arround but it might eas your work.
if working with sequmce diagram does not meet your needs then IMHO UML won't help you for that.
you might want to try OPM at :
http://www.objectprocess.org/

This a new grate design methodology, but much less standard then UML and thowgh you can track there everything exactly (and even run logical test!).
it requires from you a much exact and complete design then UML (=might be more work) it is very user friendly and free.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

bomber

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Method Parameter Tracing
« Reply #2 on: January 09, 2005, 11:40:53 am »
The downside of having to use an external tool is to export my whole model, etc. The question was two-fold. Firstly, how do other people keep track of the object interfaces i a easy way? One cannot keep it all in your head, especially if it changes a lot. Also if EA provided an easy way to view them (Project Browser is not elegant enough for this purpose), then it would be fine, but managing the required parameters down the call stack would be useful.

Secondly, I realise that this has nothing to do with UML per se, but wouldn't a feature like this enhance EA?

Thanks

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Method Parameter Tracing
« Reply #3 on: January 09, 2005, 01:03:54 pm »
The problem is not nesesarily technical, the problem would be how to model such a thing?
how would you mark that P4 moved from Obj1 to Obj2 is same P4 moved from Obj2 ot Obj3.
It is surely possible to model, but not trivial and ,as you mentioned, it is not UML.

Maybe you should turn to OMG staff to enter it as UML feature, it looks like you've got a good idea.
« Last Edit: January 09, 2005, 01:04:57 pm by MartinT »
Recursion definition:
If you don’t understand the definition read "Recursion definition".