Skip to content

Rename ScoreComponent's pattern methods #4

@ethanroday

Description

@ethanroday

In order to correctly discern between the score's tree and the actual formatted object graph, we must make the following distinction:

  • add() will now be the method for the developer-facing score model.

  • addChild() will now be the method for the internal composite structure.

  • Each class will keep track of a nextLevelDown attribute, so that the implementation of the add() method can be encapsulated in ScoreComponent as:

    add(child) {
        this.nextLevelDown.addChild(child);
    }
    

    Thus, the constructor of ScoreComponent should contain this.nextLevelDown = this as the default, and subclasses can modify if needed. For example, Part should have this.nextLevelDown = this.voiceGroup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions