Documentation ¶
Overview ¶
Package puml provides generators for PlantUML files from [qb]MDD models.
Index ¶
Constants ¶
const ( MixAggregation = "o--" MixDependency = "..>" MixContainment = "+--" MixImplementation = "..|>" DeriveUML = "/ " DeriveCog = "<&cog> " )
const DefaultClassPreamble = `hide empty attributes
hide empty methods
hide circle
`
const DefaultPackagePreamble = `hide empty attributes
hide empty methods
hide circle
`
Variables ¶
var DefaultClassDiagram = ClassDiagram{ Preamble: DefaultClassPreamble, EnumLiteralLimit: 5, ShowAttributes: OwnAtts, MixinRelation: MixDependency, DeriveSymbol: DeriveUML, }
var DefaultPackageDiagram = PackageDiagram{ Preamble: DefaultPackagePreamble, }
var PUMLTag pumlTag
Functions ¶
Types ¶
type AttributeDisplay ¶ added in v0.11.5
type AttributeDisplay uint
const ( // Classes show their own attributes OwnAtts AttributeDisplay = (1 << iota) // Classes show attributes received from mixins MixedAtts )
type ClassDiagram ¶
type ClassDiagram struct { Preamble string EnumLiteralLimit int ShowAttributes AttributeDisplay MixinRelation string DeriveSymbol string Focus *mdd.Package AtomName func(mdd.Name) string EnumName func(mdd.Name) string EnumLiteralName func(mdd.Name) string AttributeName func(mdd.Name) string AssociationName func(mdd.Name) string AssocEndName func(mdd.Name) string KeyName func(mdd.Name) string // contains filtered or unexported fields }
ClassDiagram is used to create PlantUML class diagram files from an mdd.Model. In some respects, UML is used somewhat loosely to accommodate the specific semantics of [qb]MDD.
Composition associations are solely used for attributes of class types. To remove clutter from a diagram it is possible to force to inline such attributes using the PUMLTag with an Attribute value.
mdd.Associations are never shown as aggregation or composition its always a plain association.
Mixed in classes are linked from the receiver as a Containment. Hopefully, this deviation from UML is noticeable enough to allow the viewer to take a closer look. In my opinion, other representations run the risk of being overlooked. This can be customized with ClassDiagram.MixinRelation.
Embedded attributes of class or enum types are highlighted with special symbols so that a reader is aware that the type is present as its own symbol somewhere on the diagram.
Keys have a special notation and a separate compartment to be able to show more than one key per class.