How To Doc - nplant/nplant GitHub Wiki

How-to collapse a base class hierarchy

Sometimes showing a base class in a diagram can create a lot of noise. Let's say you have 12 classes all with a common base class. It's possible that this common base class it's relevant to the story your diagram is telling. You can remove this "extends" noise with the HideAsBase() method. Specifying this in your diagram will cause the members of the base class to be represented on the subclass(es) instead.

public class SimpleDiagram : ClassDiagram
{
    public SimpleDiagram()
    {
        this.GenerationOptions.ForType<CommonBase>().HideAsBase();
        AddClass<Foo>();
        AddClass<Bar>();
        AddClass<Baz>();
    }
}
⚠️ **GitHub.com Fallback** ⚠️