Book a Demo

Author Topic: generating class diagrams  (Read 13275 times)

dave1b

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • if only you knew...
    • View Profile
generating class diagrams
« on: March 26, 2007, 01:53:52 am »
Hi there,

is there an automatic option for creating class diagrams from an entire project (multiple packages)?

I am currently manually generating an overview class diagram from an imported package structure so that I can review code generated by an off-shore team.  I would like to know if there is an option or add in for doing this.

thanks  :)

Dave

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: generating class diagrams
« Reply #1 on: March 26, 2007, 02:11:13 am »
If I understand you correctly you imported existing classes to a package (or packages) within the project browser. Have you tried importing them into a diagram instead? This is how I do it: just import to a diagram, throw away (remove) what's not needed in that particular diagram, then autolayout, and possibly correct the layout a bit.

There are some properties that affect the way autolayout work, although, after setting them to my taste I immediately forgot where I found them  ;D

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: generating class diagrams
« Reply #2 on: March 26, 2007, 02:26:16 am »
In the diagram options dialog (F5 when the diagram is open, or double-click the diagram) look for the Set Layout Style button on the right side two thirds of the way down.
No, you can't have it!

dave1b

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • if only you knew...
    • View Profile
Re: generating class diagrams
« Reply #3 on: March 26, 2007, 06:27:35 am »
Hi there

thanks for your replies!


I need a master diagram that contains all package contents (every class in the project).

I have created this manually so far by:
  • importing a directory structure into the project view.
  • dragging the classes from each individual package in the project view onto my master diagram until I have all of them.  
  • Then I use Layout to arrange them.


Although this approach works, it is very slow and needs to be repeated when new classes are created.  (I am going to be reviewing code like this daily from now on with a large team whose progress I must review)

What I need is a way of doing this easier and quicker.

I have tried importing the source files directly into the image (by right clicking the image background and selecting the "import from source files" sub-menu).  This does not seem to import the entire hierarchy :(

any ideas?

thanks

Dave


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: generating class diagrams
« Reply #4 on: March 26, 2007, 08:03:02 am »
Depending on how your project is structured (the degree to which your elements are interconnected) you may find the following helpful.

Drag an element onto a diagram. Right-click the element element, and from the context menu choose Add | Insert Related Elements. Fill out the dialog as required, and execute.
No, you can't have it!

dave1b

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • if only you knew...
    • View Profile
Re: generating class diagrams
« Reply #5 on: March 26, 2007, 08:21:45 am »
 :) thanks for this Midnight

"Drag an element onto a diagram. Right-click the element element, and from the context menu choose Add | Insert Related Elements. Fill out the dialog as required, and execute."

This certainly gets me a lot closer than I was before!

This will leave off orphaned classes which I was also hoping to review though :(

it's a pity there doesn't seem to be a way to select classes across multiple packages in the project view (select all classes functionality).

I'm aware that it may appear that I'm using the wrong tool for the job here (using EA to review class design) but this is one of the few tools capable of producing UML compatible with actionscript

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: generating class diagrams
« Reply #6 on: March 26, 2007, 01:06:27 pm »
Quote
I have tried importing the source files directly into the image (by right clicking the image background and selecting the "import from source files" sub-menu).  This does not seem to import the entire hierarchy :(

Try Project | Source Code Engineering | Import Source Directory.  There is are checkboxes there for creating diagrams for each package, and for recursively processing directories.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: generating class diagrams
« Reply #7 on: March 26, 2007, 01:57:41 pm »
Quote
This will leave off orphaned classes which I was also hoping to review though :(

There is a 'canned' report to find orphans, which might at least help you hunt them down.

If (I just don't know, so you'll have to check) you can do a Locate in Project Browser (Alt-G) from the report results it would speed things up considerably. There is also a Find in Diagrams function (Control-U).

This sounds like something you could quickly do with an add-in, or automation project. Something like that would give you a (limited) version of your Select All functionality.

David
No, you can't have it!

dave1b

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • if only you knew...
    • View Profile
Re: generating class diagrams
« Reply #8 on: March 26, 2007, 11:47:27 pm »
Hi there,

thanks for your continued help!
I think that maybe we should get a consultant in to give us a guided tour of EA to show us how to get the most value from it for our development requirements.

I can't seem to find anything about this report for orphans in the help though.

cheers

Dave

thomaskilian

  • Guest
Re: generating class diagrams
« Reply #9 on: March 26, 2007, 11:58:54 pm »
It's the first to appear when you ask for Orphan in the help.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: generating class diagrams
« Reply #10 on: March 27, 2007, 01:35:37 am »
To be precise, it is the first result when you enter orphan in the Search tab of the EA help. It does not come up via the Index tab. I just tried it to be sure.
No, you can't have it!

dave1b

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • if only you knew...
    • View Profile
Re: generating class diagrams
« Reply #11 on: March 27, 2007, 04:13:21 am »
Hi there

maybe I've got a different version of the product, mine's 6.1.792 corporate

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: generating class diagrams
« Reply #12 on: March 27, 2007, 06:27:47 am »
The current version and build are 6.5.804. I suggest you update. Much has happened.

You might want to browse through the update history first. You can find the release notes on the Sparx site, or in the Latest News section of this forum.
No, you can't have it!