pierre3 / PlantUmlClassDiagramGenerator

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

fix: fix associations (nullable, Associated types, etc.) #88

Closed PendingChanges closed 10 months ago

PendingChanges commented 10 months ago

FIxes #83 #37 #11

pierre3 commented 10 months ago

Regarding the fixes for #37 and #11.

If the type of the member is a collection, this works fine, but if it's not a collection, it changes the meaning and is not convenient.

class item
{
    public string Name { get; set; }
}
class classA
{
    //collection type
    public IList<item> Items { get; set; }
}

image

class ArgType
{
}
class Item<T>
{
    public T Value { get; set; }
}

class classB
{
    //non-collection type
    public Item<ArgType> Item { get; set; }
}

image

The related type is not ArgType but rather Item<ArgType>, so the meaning changes.

pierre3 commented 10 months ago

In the current implementation, there isn't a clear way to determine whether the type of a property or field is a collection. It would be helpful to have a good solution if available.

pierre3 commented 10 months ago

@PendingChanges Could you please create a separate Pull Request for #83? It would be helpful if you could create Pull Requests for each feature if possible.

Remi-Aubert commented 10 months ago

@PendingChanges Could you please create a separate Pull Request for #83? It would be helpful if you could create Pull Requests for each feature if possible.

Yes your're right!

Remi-Aubert commented 10 months ago

In the current implementation, there isn't a clear way to determine whether the type of a property or field is a collection. It would be helpful to have a good solution if available.

I went into this issue while fixing it, will look at it again.

Maybe have a whitelist of type considered as collection and a parameter in the command line to add custom collection type should be an idea?

pierre3 commented 10 months ago

I think it's good. think that's the best way to approach it given the current situation.