Beispiel #1
0
 /// <summary>
 /// Creates a(n) BCC based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a(n) BCC.</param>
 /// <returns>The newly created BCC.</returns>
 /// </summary>
 public IBcc CreateBcc(BccSpec specification)
 {
     return(new UpccBcc(UmlClass.CreateAttribute(BccSpecConverter.Convert(specification, Name)), this));
 }
Beispiel #2
0
 /// <summary>
 /// Updates a(n) BCC to match the given <paramref name="specification"/>.
 /// <param name="bcc">A(n) BCC.</param>
 /// <param name="specification">A new specification for the given BCC.</param>
 /// <returns>The updated BCC. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IBcc UpdateBcc(IBcc bcc, BccSpec specification)
 {
     return(new UpccBcc(UmlClass.UpdateAttribute(((UpccBcc)bcc).UmlAttribute, BccSpecConverter.Convert(specification, Name)), this));
 }
Beispiel #3
0
        internal static UmlClassSpec Convert(AccSpec accSpec)
        {
            var umlClassSpec = new UmlClassSpec
            {
                Stereotype   = "ACC",
                Name         = accSpec.Name,
                TaggedValues = new[]
                {
                    new UmlTaggedValueSpec("businessTerm", accSpec.BusinessTerms),
                    new UmlTaggedValueSpec("definition", accSpec.Definition),
                    new UmlTaggedValueSpec("dictionaryEntryName", accSpec.DictionaryEntryName)
                    {
                        DefaultValue = GenerateDictionaryEntryNameDefaultValue(accSpec)
                    },
                    new UmlTaggedValueSpec("languageCode", accSpec.LanguageCode),
                    new UmlTaggedValueSpec("uniqueIdentifier", accSpec.UniqueIdentifier)
                    {
                        DefaultValue = GenerateUniqueIdentifierDefaultValue(accSpec)
                    },
                    new UmlTaggedValueSpec("versionIdentifier", accSpec.VersionIdentifier),
                    new UmlTaggedValueSpec("usageRule", accSpec.UsageRules),
                },
            };

            var dependencySpecs = new List <UmlDependencySpec>();

            if (accSpec.IsEquivalentTo != null)
            {
                dependencySpecs.Add(new UmlDependencySpec
                {
                    Stereotype = "isEquivalentTo",
                    Target     = ((UpccAcc)accSpec.IsEquivalentTo).UmlClass,
                    LowerBound = "0",
                    UpperBound = "1",
                });
            }
            umlClassSpec.Dependencies = dependencySpecs;

            var attributeSpecs = new List <UmlAttributeSpec>();

            if (accSpec.Bccs != null)
            {
                foreach (var bccSpec in accSpec.Bccs)
                {
                    attributeSpecs.Add(BccSpecConverter.Convert(bccSpec, accSpec.Name));
                }
            }
            umlClassSpec.Attributes = MakeAttributeNamesUnique(attributeSpecs);

            var associationSpecs = new List <UmlAssociationSpec>();

            if (accSpec.Asccs != null)
            {
                foreach (var asccSpec in accSpec.Asccs)
                {
                    associationSpecs.Add(AsccSpecConverter.Convert(asccSpec, accSpec.Name));
                }
            }
            umlClassSpec.Associations = MakeAssociationNamesUnique(associationSpecs);

            return(umlClassSpec);
        }