pierre3 / PlantUmlClassDiagramGenerator

This is a generator to create a class-diagram of PlantUML from the C# source code.
MIT License
683 stars 133 forks source link

Feature/attribute relations #9

Closed rianwouters closed 5 years ago

rianwouters commented 5 years ago

solves issue #8 by adding relations for non-trivial attribute types

rianwouters commented 5 years ago

fixing property support...

pierre3 commented 5 years ago

Hi @rianwouters Thank you for adding great feature! This is exactly the feature we wanted!!

I want to merge immediately, but I found the following problems. I have committed the fixed code, so please check it.


  1. If a class that inherits a generic type is declared first, nested declarations are output. Also, properties declared later were not output.

for example

    class SubClassX : BaseClass<int>
    {
        public GenericsType Gt { get; set; }
    }

    class BaseClass<Tx>
    {
        public Tx X { get; set; }
    }

It is output as follows

class SubClassX {
    class "BaseClass`1"<Tx> {    
    }
}
  1. Changed not to associate fields and properties of generic type argument (T1, T2, etc...).
class GenericsType<T1, T2>
{
    public T1 Value1 { get; }
    public T2 Value2;
}

Output result

class "GenericsType`2"<T1,T2> {
}
"GenericsType`2" --> "Value1" T1
"GenericsType`2" --> "Value2" T2 

I changed it as follows

class "GenericsType`2"<T1,T2> {
    + Value1 : T1 <<get>>
    + Value2 : T2
}
rianwouters commented 5 years ago

Thanks. I'll check ASAP

pierre3 commented 5 years ago

I merged tentatively this PR If there is a problem, please create a new issue or PR.