internal static UmlClassSpec Convert(MaSpec maSpec)
        {
            var umlClassSpec = new UmlClassSpec
            {
                Stereotype = "MA",
                Name       = maSpec.Name,
            };

            var associationSpecs = new List <UmlAssociationSpec>();

            if (maSpec.Asmas != null)
            {
                foreach (var asmaSpec in maSpec.Asmas)
                {
                    associationSpecs.Add(AsmaSpecConverter.Convert(asmaSpec, maSpec.Name));
                }
            }
            umlClassSpec.Associations = MakeAssociationNamesUnique(associationSpecs);

            return(umlClassSpec);
        }
Example #2
0
 /// <summary>
 /// Creates a MA based on the given <paramref name="specification"/>.
 /// <param name="specification">A specification for a MA.</param>
 /// <returns>The newly created MA.</returns>
 /// </summary>
 public IMa CreateMa(MaSpec specification)
 {
     return(new UpccMa(UmlPackage.CreateClass(MaSpecConverter.Convert(specification))));
 }
 public IMa UpdateMa(IMa ma, MaSpec specification)
 {
     throw new NotImplementedException();
 }
Example #4
0
 /// <summary>
 /// Updates a MA to match the given <paramref name="specification"/>.
 /// <param name="ma">A MA.</param>
 /// <param name="specification">A new specification for the given MA.</param>
 /// <returns>The updated MA. Depending on the implementation, this might be the same updated instance or a new instance!</returns>
 /// </summary>
 public IMa UpdateMa(IMa ma, MaSpec specification)
 {
     return(new UpccMa(UmlPackage.UpdateClass(((UpccMa)ma).UmlClass, MaSpecConverter.Convert(specification))));
 }
 public IMa CreateMa(MaSpec specification)
 {
     throw new NotImplementedException();
 }