Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
130 stars 24 forks source link

ST6RI-684 Implement invocation delegates for operations #554

Closed arminzavada closed 8 months ago

arminzavada commented 8 months ago

PR #380 used the EMF mechanism for "setting delegates" to move the handwritten code for the computation of derived property values out of the generated EMF Impl classes and into delegate classes. However, this still left handwritten code in the Impl classes for the implementation of OCL operations from the KerML and SysML specifications that are used in the specification of various OCL constraints. Similarly to the previous PR, the present PR uses the EMF mechanism for "invocation delegates" (as described here) to move the handwritten code for operation implementation out of the Impl classes and into delegate classes.

Invocation Delegates

  1. Reorganized the existing omg.org.sysml.delegate package into omg.org.sysml.delegate.setting and added a new omg.org.sysml.delegate.invocation package.
  2. Implemented and registered a new OperationInvocationDelegateFactory class.
  3. Implementied a generic OperationInvocationDelegateSelector to select the appropriate delegate class at runtime, to support operation redefinition.
  4. Extracted the operation implementation code into delegate classes.

Custom UML Importer

  1. Updated the org.omg.sysml.uml.ecore.importer.CustomUMLImporter to give the ECore annotation to the sysml Epackage in SysML.ecore (added in PR 380) the additional pair invocationDelegates->http://www.omg.org/spec/SysML. This declares http://www.omg.org/spec/SysML to be the annotation to be used on operations to be delegated.
  2. Updated the CustomUML2EcoreConverter class to add a http://www.omg.org/spec/SysML annotation to every operation in SysML.ecore, so the appropriate delegation is generated into the Impl classes.
seidewitz commented 8 months ago

I have implemented the following:

Please review.

Still to do: Implement delegates for operations related to importing and inheritance.

seidewitz commented 8 months ago

I have completed the invocation delegate implementations, including:

Please review.