The future perfect is used when projecting into to the future as if to predict an outcome that will occur once a person sets out on a course of action. So if someone is going to get a diploma in marketing at a business school he can say, "I will have completed my program in marketing by the time I finish my business exam". It is often used with time phrases like, "by the time". These phrases can be used before or after the future perfect phrase. The speaker should also feel free to invert his word order when using the other perfect tenses as well.
The same time phrase can be used with the present perfect continuous to relate interest not in the final goal as much as in the process of getting there. So when one say I will have been working on stem cells five years by the time I turn thirty, he is referring to an arc of time in the future during which he will be working and all that is a way of his expressing acquired experience. If a spontaneous decision is going to be made that will cause a process to occur in the future than I can express that with a phrase like: “Once he has settled down, he will have decided on his what he wants to do”. The future perfect part of that sentence can be modified by putting a gerund phrase after the preposition on to say something like: “He will have decided on going to school or not””