FUML 1.0b2 NO IDEA Avatar
  1. OMG Issue

FUML — ExecutionFactory::instantiateVisitor should not use Java reflection

  • Key: FUML-11
  • Legacy Issue Number: 13453
  • Status: closed  
  • Source: Model Driven Solutions ( Mr. Ed Seidewitz)
  • Summary:

    Specification: Semantics of a Foundation Subset for Executable UML Models, FTF – Beta 1 (ptc/08-11-03)
    Section: 8.2.2.2 ExecutionFactory

    Summary:

    The ExecutionFactory::instantiateVisitor operation currently uses Java reflection to instantiate an appropriate visitor class. However, there is no Annex A mapping for this.

    Proposed Resolution:

    Remove the “suffix” parameter from the signature for instantiateVisitor and update the calls in ExecutionFactory::createExecution, ExecutionFactory::createEvaluation and ActivityNodeActivationGroup::createNodeActivation to remove the corresponding second argument. Replace the body of instantiateVistor with:

    // Instantiate a visitor object for the given element.

    SemanticVisitor visitor = null;

    if (element instanceof fUML.Syntax.Classes.Kernel.LiteralBoolean)

    { visitor = new fUML.Semantics.Classes.Kernel.LiteralBooleanEvaluation(); }

    if (element instanceof fUML.Syntax.Classes.Kernel.LiteralString)

    { visitor = new fUML.Semantics.Classes.Kernel.LiteralStringEvaluation(); }

    if (element instanceof fUML.Syntax.Classes.Kernel.LiteralNull)

    { visitor = new fUML.Semantics.Classes.Kernel.LiteralNullEvaluation(); }

    if (element instanceof fUML.Syntax.Classes.Kernel.InstanceValue)

    { visitor = new fUML.Semantics.Classes.Kernel.InstanceValueEvaluation(); }

    if (element instanceof fUML.Syntax.Classes.Kernel.LiteralUnlimitedNatural)

    { visitor = new fUML.Semantics.Classes.Kernel.LiteralUnlimitedNaturalEvaluation(); }

    if (element instanceof fUML.Syntax.Classes.Kernel.LiteralInteger)

    { visitor = new fUML.Semantics.Classes.Kernel.LiteralIntegerEvaluation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.Activity)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.ActivityExecution(); }

    if (element instanceof fUML.Syntax.Actions.BasicActions.OutputPin)

    { visitor = new fUML.Semantics.Actions.BasicActions.OutputPinActivation(); }

    if (element instanceof fUML.Syntax.Actions.BasicActions.InputPin)

    { visitor = new fUML.Semantics.Actions.BasicActions.InputPinActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.StartClassifierBehaviorAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.StartClassifierBehaviorActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ReadStructuralFeatureAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ReadStructuralFeatureActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.CompleteStructuredActivities.ConditionalNode)

    { visitor = new fUML.Semantics.Activities.CompleteStructuredActivities.ConditionalNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ReadSelfAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ReadSelfActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.DestroyLinkAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.DestroyLinkActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.CompleteStructuredActivities.StructuredActivityNode)

    { visitor = new fUML.Semantics.Activities.CompleteStructuredActivities.StructuredActivityNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.BasicActions.SendSignalAction)

    { visitor = new fUML.Semantics.Actions.BasicActions.SendSignalActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.ExtraStructuredActivities.ExpansionNode)

    { visitor = new fUML.Semantics.Activities.ExtraStructuredActivities.ExpansionNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.CreateObjectAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.CreateObjectActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ReadLinkAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ReadLinkActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ClearAssociationAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ClearAssociationActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.JoinNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.JoinNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.ReclassifyObjectAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.ReclassifyObjectActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.InitialNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.InitialNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.StartObjectBehaviorAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.StartObjectBehaviorActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.ReadIsClassifiedObjectAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.ReadIsClassifiedObjectActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.BasicActions.CallOperationAction)

    { visitor = new fUML.Semantics.Actions.BasicActions.CallOperationActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.BasicActions.CallBehaviorAction)

    { visitor = new fUML.Semantics.Actions.BasicActions.CallBehaviorActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.ExtraStructuredActivities.ExpansionRegion)

    { visitor = new fUML.Semantics.Activities.ExtraStructuredActivities.ExpansionRegionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.AddStructuralFeatureValueAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.AddStructuralFeatureValueActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.ActivityParameterNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.ActivityParameterNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ValueSpecificationAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ValueSpecificationActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.ActivityFinalNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.ActivityFinalNodeActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.ForkNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.ForkNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.AcceptEventAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.AcceptEventActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.CompleteStructuredActivities.LoopNode)

    { visitor = new fUML.Semantics.Activities.CompleteStructuredActivities.LoopNodeActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.DecisionNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.DecisionNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.ReduceAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.ReduceActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.DestroyObjectAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.DestroyObjectActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.ClearStructuralFeatureAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.ClearStructuralFeatureActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.TestIdentityAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.TestIdentityActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.CreateLinkAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.CreateLinkActionActivation(); }

    if (element instanceof fUML.Syntax.Actions.IntermediateActions.RemoveStructuralFeatureValueAction)

    { visitor = new fUML.Semantics.Actions.IntermediateActions.RemoveStructuralFeatureValueActionActivation(); }

    if (element instanceof fUML.Syntax.Activities.IntermediateActivities.MergeNode)

    { visitor = new fUML.Semantics.Activities.IntermediateActivities.MergeNodeActivation(); }

    if (element instanceof fUML.Syntax.Actions.CompleteActions.ReadExtentAction)

    { visitor = new fUML.Semantics.Actions.CompleteActions.ReadExtentActionActivation(); }

    return visitor;

  • Reported: FUML 1.0b1 — Fri, 6 Feb 2009 05:00 GMT
  • Disposition: Resolved — FUML 1.0b2
  • Disposition Summary:

    The proposed resolution will only work at conformance level 3 (L3). That is because it references classes that are not available at lower conformance levels.
    Accommodating all three conformance levels requires having a different instantiateVistor implementation for each level. This can be achieved by making ExecutionFactory abstract and added three concrete subclasses, one for each conformance level, each of which appropriately overrides instantiateVisitor. Then an execution environment can be set up for the appropriate conformance level by using an instance of the correct ExecutionFactory subclass for that level.

  • Updated: Fri, 6 Mar 2015 20:58 GMT