Skip to content

Commit

Permalink
[Implement] IExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
samatstariongroup committed Oct 6, 2024
1 parent 0f56ef5 commit bc8fe51
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
28 changes: 28 additions & 0 deletions uml4net/POCO/Packages/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,33 @@ VisibilityKind INamedElement.Visibility
[Property(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isReadOnly: true, isDerived: true, isDerivedUnion: true)]
[Implements(implementation: "IRedefinableElement.RedefinitionContext")]
public IClassifier RedefinitionContext => throw new NotImplementedException();


/// <summary>
/// Indicates whether an instance of the extending stereotype must be created when an instance
/// of the extended class is created. The attribute value is derived from the value of the lower
/// property of the ExtensionEnd referenced by Extension::ownedEnd; a lower value of 1 means
/// that isRequired is true, but otherwise it is false. Since the default value of
/// ExtensionEnd::lower is 0, the default value of isRequired is false.
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isReadOnly: true, isDerived: true)]
[Implements(implementation: "IExtension.IsRequired")]
public bool IsRequired { get; }

/// <summary>
/// References the Class that is extended through an Extension. The property is derived from the type of the
/// memberEnd that is not the ownedEnd.
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isReadOnly: true, isDerived: true)]
[Implements(implementation: "IExtension.Metaclass")]
public IClass Metaclass { get; }

/// <summary>
/// References the end of the extension that is typed by a Stereotype.
/// </summary>
[Property(aggregation: AggregationKind.Composite, lowerValue: 1, upperValue: 1)]
[RedefinedProperty(propertyName: "Association-ownedEnd")]
[Implements(implementation: "IExtension.OwnedEnd")]
public IExtensionEnd OwnedEnd { get; set; }
}
}
25 changes: 25 additions & 0 deletions uml4net/POCO/Packages/IExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace uml4net.POCO.Packages
{
using uml4net.Decorators;
using uml4net.POCO.Classification;
using uml4net.POCO.StructuredClassifiers;

/// <summary>
Expand All @@ -28,5 +30,28 @@ namespace uml4net.POCO.Packages
/// </summary>
public interface IExtension : IAssociation
{
/// <summary>
/// Indicates whether an instance of the extending stereotype must be created when an instance
/// of the extended class is created. The attribute value is derived from the value of the lower
/// property of the ExtensionEnd referenced by Extension::ownedEnd; a lower value of 1 means
/// that isRequired is true, but otherwise it is false. Since the default value of
/// ExtensionEnd::lower is 0, the default value of isRequired is false.
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isReadOnly: true, isDerived:true)]
public bool IsRequired { get; }

/// <summary>
/// References the Class that is extended through an Extension. The property is derived from the type of the
/// memberEnd that is not the ownedEnd.
/// </summary>
[Property(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isReadOnly: true, isDerived: true)]
public IClass Metaclass { get; }

/// <summary>
/// References the end of the extension that is typed by a Stereotype.
/// </summary>
[Property(aggregation: AggregationKind.Composite, lowerValue: 1, upperValue: 1)]
[RedefinedProperty(propertyName: "Association-ownedEnd")]
public IExtensionEnd OwnedEnd { get; set; }
}
}

0 comments on commit bc8fe51

Please sign in to comment.