Skip to content

Move code to an Interaction class to improve maintainability

The following discussion from !21 should be addressed:

  • @remon started a discussion:

    I love how the code in this switch statement has no lines longer than 80 characters, even at indentation level eight 😉 But it is usually a good indicator (code smell) that code should be extracted. In this case I think it would be nice to define the classes PopupAction and HighlightAction, each having an applyTo(graph, target) function. Or one class to rule them all and in the darkness.bind() them, but there already is an Action class in mxGraph. On second thought, an Interaction class is probably more useful, and would allow some other improvements elsewhere.

    Please close this discussion by creating a new issue, titled something like "Move code to an Interaction class to improve maintainability", to be solved later.