/// <summary> /// Creates a(n) SUP based on the given <paramref name="specification"/>. /// <param name="specification">A specification for a(n) SUP.</param> /// <returns>The newly created SUP.</returns> /// </summary> public IBdtSup CreateBdtSup(BdtSupSpec specification) { return(new UpccBdtSup(UmlClass.CreateAttribute(BdtSupSpecConverter.Convert(specification, Name)), this)); }
/// <summary> /// Updates a(n) SUP to match the given <paramref name="specification"/>. /// <param name="bdtSup">A(n) SUP.</param> /// <param name="specification">A new specification for the given SUP.</param> /// <returns>The updated SUP. Depending on the implementation, this might be the same updated instance or a new instance!</returns> /// </summary> public IBdtSup UpdateBdtSup(IBdtSup bdtSup, BdtSupSpec specification) { return(new UpccBdtSup(UmlClass.UpdateAttribute(((UpccBdtSup)bdtSup).UmlAttribute, BdtSupSpecConverter.Convert(specification, Name)), this)); }
internal static UmlClassSpec Convert(BdtSpec bdtSpec) { var umlClassSpec = new UmlClassSpec { Stereotype = "BDT", Name = bdtSpec.Name, TaggedValues = new[] { new UmlTaggedValueSpec("businessTerm", bdtSpec.BusinessTerms), new UmlTaggedValueSpec("definition", bdtSpec.Definition), new UmlTaggedValueSpec("dictionaryEntryName", bdtSpec.DictionaryEntryName) { DefaultValue = GenerateDictionaryEntryNameDefaultValue(bdtSpec) }, new UmlTaggedValueSpec("languageCode", bdtSpec.LanguageCode), new UmlTaggedValueSpec("uniqueIdentifier", bdtSpec.UniqueIdentifier) { DefaultValue = GenerateUniqueIdentifierDefaultValue(bdtSpec) }, new UmlTaggedValueSpec("versionIdentifier", bdtSpec.VersionIdentifier), new UmlTaggedValueSpec("usageRule", bdtSpec.UsageRules), }, }; var dependencySpecs = new List <UmlDependencySpec>(); if (bdtSpec.IsEquivalentTo != null) { dependencySpecs.Add(new UmlDependencySpec { Stereotype = "isEquivalentTo", Target = ((UpccBdt)bdtSpec.IsEquivalentTo).UmlClass, LowerBound = "0", UpperBound = "1", }); } if (bdtSpec.BasedOn != null) { dependencySpecs.Add(new UmlDependencySpec { Stereotype = "basedOn", Target = ((UpccCdt)bdtSpec.BasedOn).UmlClass, LowerBound = "0", UpperBound = "1", }); } umlClassSpec.Dependencies = dependencySpecs; var attributeSpecs = new List <UmlAttributeSpec>(); if (bdtSpec.Con != null) { attributeSpecs.Add(BdtConSpecConverter.Convert(bdtSpec.Con, bdtSpec.Name)); } if (bdtSpec.Sups != null) { foreach (var bdtSupSpec in bdtSpec.Sups) { attributeSpecs.Add(BdtSupSpecConverter.Convert(bdtSupSpec, bdtSpec.Name)); } } umlClassSpec.Attributes = MakeAttributeNamesUnique(attributeSpecs); return(umlClassSpec); }