Book a Demo

Author Topic: Generating Class Diagrams  (Read 3545 times)

raghu

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Generating Class Diagrams
« on: October 06, 2008, 02:55:42 pm »
Hi All,

I have the java source code with lot of interfaces and classes, the heirarchy is very complex and i need to generate the class diagrams of the whole. please please tell me the steps to generate the same using Enterprise Architect.

Thanks,
Raghu

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating Class Diagrams
« Reply #1 on: October 06, 2008, 11:55:04 pm »
You might go about this in either of two methods: reverse engineering the code or importing a binary module (your .jar file).

Both are documented in the Code Engineering section of EA help, but you will need to look around a bit.

Hint: Make sure that your target package and project have Java set as the code language. This is the default in EA, so unless you've tweaked this you should be OK.

If you need to model references to types in the Java libraries then you should first import those libraries as binary modules. There is information in the EA help, as well as several forum threads that you can search for, that will help.

Hopefully this will point you in the correct direction. Once you get the hang of it things will happen quickly.

David
No, you can't have it!

raghu

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Generating Class Diagrams
« Reply #2 on: October 07, 2008, 01:29:16 am »
Thanks David...

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Generating Class Diagrams
« Reply #3 on: October 07, 2008, 08:23:29 am »
Additionally, EA doesn't create a diagram with everything on it when you import a source directory.  This very quickly becomes impractical for even trivial examples.

You will need to add classes onto a diagram yourself.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating Class Diagrams
« Reply #4 on: October 07, 2008, 09:12:35 am »
Ouch!

Perhaps you'd care to issue a feature request on this Raghu. Use the Feature Request link below the Support link near the bottom of any forum page.

Remember to paste a link to this forum thread into your request, so the Sparxians can participate in this discussion.

And please post back here to let us know if you hear back from Sparx on this, or if you have any insights on how well this works (with or without the new feature). It always helps to keep the rest of us in the loop.

David
No, you can't have it!

raghu

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Generating Class Diagrams
« Reply #5 on: October 07, 2008, 07:33:27 pm »
Thanks for the reply David, I got the class diagrams from EA, but please tell whether can i do like below.

By reverse Engineering process I got the Class Diagram per package, and relation ship is explained pictorially only for that package, but i need the pictorial representation of classes and interfaces in all the packages in my projects. I have around 100 Interfaces and some 200 Classes in my Project, and most of things are interlinked.

I mean i have a interface which is implemented by many classes, and which class method to execute? is decided in runtime, so my diagram should help me to identify which class method is called. I Hope my explanation is not vague :)
« Last Edit: October 07, 2008, 07:34:32 pm by raghuprasad »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating Class Diagrams
« Reply #6 on: October 08, 2008, 12:00:37 am »
Well, if this is decided at runtime it might not be suitable for a class or package diagram.

Perhaps you need a composite structure diagram, or one or more of the behavioral diagram types. You might also want to illustrate the logic behind the choice via a state chart or other behavioral model (depending on how you trigger the decision).

As to which classes realize (i.e. implement) the interface, use a «realize» connector. I have found that EA adds these for me when I reverse engineer code, so check your EA settings (and your source code) to make sure these are captured (and that they are present in the source code).

Remember that EA will not show a connector (including realization) on a diagram unless the elements at both ends are also shown. You might have to handle this by hand. This could also be affected by your settings for how packages are created when you reverse engineer.

Sorry I cannot be more specific, but you are the one who has the code, and the understanding of the actual requirements.

David
No, you can't have it!

raghu

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Generating Class Diagrams
« Reply #7 on: October 08, 2008, 02:32:13 am »
Thanks much for your guidance David:) i will spend some hrs in this weekend, i should find out some way to do it. Will reply you once i found a solution.