It is a single quatrain with external rhymes that follow the pattern of AABB and with a trochaic metre , which is common in nursery rhymes . The melody commonly associated with the rhyme was first recorded by composer and nursery rhyme collector James William Elliott in his National Nursery Rhymes and Nursery Songs ( London , 1870 ) . The Roud Folk Song Index catalogues folk songs and their variations by number , and classify this song as 13026 .