A Tutorial on Design Patterns for Music Notation Software

Factory: A Creational Pattern Another obvious requirement for music-notation software is the ability to insert notation into an existing score. A typical example is inserting a note into the score. The need to insert a note is present in several places in the OMIS software: the editor must be able to do so, and so must the part of OMIS that interprets the textual output from the scanning phase. As software designers, we want to encapsulate this note-creation process into one method. The underlying code must do something along like the following: void insertNote(Staff *staff, int atStaffDegree) { Note *newNote = new Note(); staff->insertNote(newNote, atStaffDegree);