One of the most outstanding literary techniques used by Paulo Coelho in The Alchemist is that of the allegory. This literary device is described in some cases as an extended metaphor. The story serves to show a young man who is searching for treasure: literally. He has had a dream repeatedly over the years and finally goes to find the riches he searches for. The overriding message of this book is that that which is the most valuable in life is not wealth that can be accumulated, but realizing your dreams, working hard to achieve that which you are meant to achieve in life and finding love. In this story, both things happen to Santiago: he finds his personal legend, etc., and also finds great tangible wealth.
There are many biblical allusions in the story as well. The character of Melchizedek (the King of Salem) may well refer to God, as noted in many historical/biblical texts, scripture, etc. More than once, Santiago is required to give away ten percent of his sheep: once to the gypsy and once to Melchizedek. In the biblical tradition, this is called tithing, which is to give ten percent of what one owns to God. And, Santiago can be seen as a Christ-like figure. He is literally a shepherd, while Christ is a figurative shepherd. Additionally, both are on a journey to fulfill the fate that has been placed before them if they will only continue on the path, which both Santiago and Christ do.