What is the central theme of the poem, The Seven Ages?

What is the central theme of the poem, The Seven Ages? How does Shakespeare compare life of a person to drama?

The central theme of the poem is that the cycle of life from birth to death is inescapable and we should play the roles assigned to us at various stages just like professional actors. Shakespeare compares the world to a stage on which the drama of life is carried out by men at various stages in life, who are actors in the drama. They enter and start acting at birth, the first stage, they finish acting at death, the seventh stage, and exit the stage. In between, they go through the five stages of childhood, youth, working age, maturity and retirement.