How do Rosalind, Orlando and Duke Frederick contribute to As You Like It being a pastoral romance?
It is very important to understand the way in which the wider context of this comedy functions in order for its full message to be heard. This is a comedy that fits into a genre called pastoral literature. This is a type of literature that explores the dichotomy between the countryside and city life. Mostly, such texts present simplistic interpretations of city life as being bad, mired by corruption and business, whereas country life is equalled with being good and heathy, populated by innocent swineherds and shepherdesses. The relationship between these two states is normally shown through the way in which a spell in the countryside is just what city dwelling characters need before they return to their urban lives.
Shakespeare however rarely presents us with such a simple and uncomplicated treatment of genre. You might like to think about the way in which characters such as Audrey are presented for example, who definitely aren't pure nor articulate. However, at the beginning of the play, the three characters you have mentioned are attracted in different ways to the simplicity of the country life as presented in Duke Senior's court. Note how Charles describes the Duke's new life in the Forest of Arden:
They say he is already in the Forest of Arden, and a many merry men with him; and there they live like the old Robin Hood of England.
In the Forest, Duke Senior and his attendants "fleete the time carelessly" as if it were "the golden age." The three characters are key in developing Shakespeare's presentation of this pastoral comedy as all of them are used to present the relationship between urban and pastoral life. By the end of the play, the pastoral idyll is exposed for the sham that it could often be said to be, characterised by danger and bawdy pretense. If country life has its benefits, then characters such as Orlando, Rosalind and Duke Ferdinand likewise realise that urban life also has its distinct advantages as characters can be free from rural simplicity and banal life that detracts from intelligent living. In many ways, the split between urban life and pastoral life, between court and the forest, is the same split between real life and the life of the theatre. The three characters you mention deliberately, for different motives, seek the life of the Forest, and end up returning to the life of the city happier, wiser and maturer characters. The pastoral comedy presents setting in terms of relationships and, importantly, balance.