Author Topic: Code Graph & Methods/Fields Acessed  (Read 591 times)

ToolmakerSteve

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Code Graph & Methods/Fields Acessed
« on: April 26, 2004, 02:08:50 pm »
I am most interested in Automatic Code Synchronization between UML diagrams and
C# source code.

I have two questions about what details can be learned from the UML diagrams.

For each question, I then describe how I would like this to work in a tool.

Consider this a "Wish List" description, as an idea for future features in your
tool.


- - - - - - - - - -
1. Do the diagrams show the "Code Graph"?
That is, for Method A in Class Foo, is there:

1.1. A list of "Methods and Properties accessed from A",

  that is, A contains calls to those methods, or gets/sets values of those
Properties.

Foo.A uses:
* Foo.X
* Foo.Y
* Walrus.C


1.2. A list of "Methods that call A".

 this is the other side of the coin: finding out who uses A.  Should be sorted
by calling class name, so can easily find all uses from a given class:
Uses of Foo.A:
* Bar.B
* Bar.C
* Foo.B
* Walrus.A


1.3. In all these lists, be able to click on that item, to go to it in either
diagram or source.

Should be an easy way to keep four window panes open, in a 2 x 2 layout:
* Class Foo, in a class diagram.
* Method A, source text.
* A Code Graph diagram.
* Source text for item being explored, such as "Bar.C".

[***NOTE: Copy this diagram into "Notepad",
or change the font to Courier New,
so that the spaces are the right size.***]

+-----.Classes.----------+-------.Code.Graph.-----------+
+........................|..............................|
|...(Bar)..---+>.(Foo)...|..Bar.B..---+>.Foo.A.+->.Foo.X|
|.............^....V.....|..Bar.C..---+........+->.Foo.Y|
|...(Walrus).-^....|.....|..Foo.B..---+........+........|
|......^-----------/.....|..Walrus.A.-+.................|
|........................|..............................|
+---.Source.Foo.A.-------+------.Source.Bar.C.----------+
|.public.void.Foo.A(.....|.internal.Int32.Bar.C(........|
|.{......................|.{............................|
|...if...................|....while.....................|
|........................|..............................|
+------------------------+------------------------------+


- - - - - - - - - -
2. Is there a way to find more detail about how one Class uses another Class?

This is similar to #1, but grouping the information together under a class.

Consider Class Foo that uses Class Bar.  That is, there would be an arrow in the
Class Diagram, from Foo to Bar.

I want to be able to right-click on that arrow, and have a pop-up item to get a
list of all methods in Bar,
that are called from any method in Foo.

In my example above, if right-clicked on the Class Diagram line from (Bar) to
(Foo),
would get pop-up item to open a Selected Code Graph, that only showed calls from
Bar methods to Foo methods.

These should be in two columns, one for Bar, one for Foo.
Each column sorted alphabetically by method name,
since the main use is to easily see which methods are called.
(If sort alphabetically, the "arrows" between methods will get rather tangled,
but that is less important.)

Suppose in addition to calls mentioned above, Method Bar.B also gets the value
of field or property Foo.X.


+--.Selected.Code.Graph.--+
|..Bar:.........Foo:......|
|.........................|
|.....B.----+-->.A........|
|.../.......|.............|
|...|.C.----/....X........|
|....\-----------^........|
+-------------------------+

As in #1, I'd like to see this as one of four panes, in that 2x2 layout.

In this case, if click on "Bar.B" in the Selected Code Graph, then
Source Text of Method Bar.B would display in the left-hand Source Pane;
if click on "Foo.A" or "Foo.X", then its Source would display in the RIGHT-hand
Source Pane.

In general, I'd like to automatically keep open two source text panes and two
diagram panes, so that I don't have to switch between different panes or move
panes around every time I select a new item to view.

The idea is that the left two windows show info about some item I am FOCUSING
on, in this case, the Bar class and its class relationships and/or its methods
and properties.

The right two windows show info about some RELATED item, in this case, the Foo
class.

-- ToolmakerSteve