Book a Demo

Author Topic: Generate UML From C# Codes  (Read 6771 times)

Evellen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generate UML From C# Codes
« on: September 12, 2007, 01:19:11 am »
I have a project in C# .NET 2008 and I want to generate UML schemas/models. HOW??? Is that possibility to synchronizite it with Code?

Thank You for the answers.
« Last Edit: September 12, 2007, 01:20:47 am by Evellen »

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate UML From C# Codes
« Reply #1 on: September 12, 2007, 06:31:12 am »
Why, are you experiencing some troubles with the normal Code Engineering then? To import/generate sources you'll go to Project/Element|Source Code Engineering -menu. To import code you'll have to first create a project and then one package under it before you can access the menu.

Code engineering should work unless C# syntax dramaticaly changes from the present. However, Visual Studio integration plug-in of EA might not work, but it only helps certain things and is not mandatory to operate with the .cs files.

Evellen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate UML From C# Codes
« Reply #2 on: September 13, 2007, 12:33:53 am »
I can generate classes and methods inside, nodes,..
But I thought connection between classes and relations between them and synchronizing with code. :'(
But it's easy to model. :-*

If you thought MDG integration, exists only for Visual Studio 2005 with .NET 2.1 we use .NET 3.5  ::) ;)  
« Last Edit: September 13, 2007, 12:34:57 am by Evellen »

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate UML From C# Codes
« Reply #3 on: September 13, 2007, 02:05:39 am »
Quote
But I thought connection between classes and relations between them and synchronizing with code. :'(


Yes, but what is the problem here? As far as I'm concerned, the synchronizing works just fine (with few tweaks to options). It is not automatic tho, you'll have to "Generate Source code" for forward sync and "Synchronize with Code" for reverse sync. Sometimes you might have an option with the later to do forward sync, but thats not the point.

It will indeed make relations between classes if you mean inheritance. Just use "Generalization" connection in the UML model for that purpose.

Also, remember that you shouldn't move the reverse engineered classes in the project tree. Because if you do move them, they won't be in the same namespace as their counter parts in the source files. In such case, it will generate completely new sources on forward sync, and the old source stays unchanged.

Evellen

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate UML From C# Codes
« Reply #4 on: September 13, 2007, 04:06:38 am »
I have one onother little problem. Can you draw in UML aspx files? Becouse i have to draw uml for one  :-X  :-/ code. A lot of redirects to aspxs. No object :( What diagrams i need to draw functionality?
I don't belive I can draw it in class diagram.
Only sequence, collaboration, use case ?
« Last Edit: September 13, 2007, 04:24:52 am by Evellen »

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate UML From C# Codes
« Reply #5 on: September 13, 2007, 06:03:17 am »
There is no built-in support for ASP-files as far as I know. However, here is a post someone says he made a free plug-in for those files: Message
I don't know how, if at all, it works.

I think that basically all diagrams under "UML Behaviour"-group in the "Project|Add Diagram" are for functional descriptioning.  

You can even automatically generate some very basic sequence diagrams thru debugging and the stack it produces. Or atleast you can do that with VS2005 and NET2.0, but mayby the Microsoft Native-option works for VS2008. Still rest assured, the diagrams it produces definently aren't a big loss.

Anyway, check the Activity diagram as well.
My own UML course is reserved to start at next month, so I don't know (yet) much about how to exactly use these diagrams in different software tasks :-/