Skip to content

Converting source code from functions to class #2242

Open
@mnp-mid

Description

Is your feature request related to a problem? Please describe.

I sometimes go through the source code and try to understand how things are working or releated to each other. The code is build based on functions / prototype structure.

I wonder, if there are any plans or if the code could move on to class structure. This has the benefit of keeping things more together and in case you plan to move on to typescript with more compiling support, this would be the next step to consider. Of course this is some work to be done, but it could go step by step.

Something like

export default class SubProcessPlaneBehavior extends CommandInterceptor {
  static $inject = ['canvas', 'eventBus', 'modeling', 'elementFactory', 'bpmnFactory', 'bpmnjs', 'elementRegistry'];

  constructor(canvas, eventBus, modeling, elementFactory, bpmnFactory, bpmnjs, elementRegistry) {
      super(eventBus)
  }
   ...
}

instead of

export default function SubProcessPlaneBehavior(
    canvas, eventBus, modeling,
    elementFactory, bpmnFactory, bpmnjs, elementRegistry) {
       CommandInterceptor.call(this, eventBus);

       ...
    }
    ...
}

SubProcessPlaneBehavior.$inject = ['canvas', 'eventBus', 'modeling', 'elementFactory', 'bpmnFactory', 'bpmnjs', 'elementRegistry'];

inherits(SubProcessPlaneBehavior, CommandInterceptor);

Describe the solution you'd like

image

Metadata

Assignees

No one assigned

    Labels

    backlogQueued in backlogenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions