internal static UmlAssociationSpec Convert(AsccSpec asccSpec, string associatingClassName)
        {
            var associatedClassifierType = ((UpccAcc)asccSpec.AssociatedAcc).UmlClass;
            var umlAssociationSpec       = new UmlAssociationSpec
            {
                Stereotype           = "ASCC",
                Name                 = asccSpec.Name,
                UpperBound           = asccSpec.UpperBound,
                LowerBound           = asccSpec.LowerBound,
                AggregationKind      = AggregationKind.Shared,
                AssociatedClassifier = associatedClassifierType,
                TaggedValues         = new[]
                {
                    new UmlTaggedValueSpec("businessTerm", asccSpec.BusinessTerms),
                    new UmlTaggedValueSpec("definition", asccSpec.Definition),
                    new UmlTaggedValueSpec("dictionaryEntryName", asccSpec.DictionaryEntryName)
                    {
                        DefaultValue = GenerateDictionaryEntryNameDefaultValue(asccSpec, associatingClassName)
                    },
                    new UmlTaggedValueSpec("languageCode", asccSpec.LanguageCode),
                    new UmlTaggedValueSpec("sequencingKey", asccSpec.SequencingKey),
                    new UmlTaggedValueSpec("uniqueIdentifier", asccSpec.UniqueIdentifier)
                    {
                        DefaultValue = GenerateUniqueIdentifierDefaultValue(asccSpec, associatingClassName)
                    },
                    new UmlTaggedValueSpec("versionIdentifier", asccSpec.VersionIdentifier),
                    new UmlTaggedValueSpec("usageRule", asccSpec.UsageRules),
                },
            };

            return(umlAssociationSpec);
        }
示例#2
0
 private static string GenerateDictionaryEntryNameDefaultValue(AsccSpec asccSpec, string associatingClassName)
 {
     return(associatingClassName + ". " + asccSpec.Name + ". " + asccSpec.AssociatedAcc.Name);
 }
示例#3
0
 private static string GenerateUniqueIdentifierDefaultValue(AsccSpec asccSpec, string associatingClassName)
 {
     return(Guid.NewGuid().ToString());
 }
示例#4
0
 /// <summary>
 /// Updates a(n) ASCC to match the given <paramref name="specification"/>.
 /// <param name="ascc">A(n) ASCC.</param>
 /// <param name="specification">A new specification for the given ASCC.</param>
 /// <returns>The updated ASCC. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IAscc UpdateAscc(IAscc ascc, AsccSpec specification)
 {
     return(new UpccAscc(UmlClass.UpdateAssociation(((UpccAscc)ascc).UmlAssociation, AsccSpecConverter.Convert(specification, Name)), this));
 }
示例#5
0
 /// <summary>
 /// Creates a(n) ASCC based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a(n) ASCC.</param>
 /// <returns>The newly created ASCC.</returns>
 /// </summary>
 public IAscc CreateAscc(AsccSpec specification)
 {
     return(new UpccAscc(UmlClass.CreateAssociation(AsccSpecConverter.Convert(specification, Name)), this));
 }