I’m in the process of developing my MVC application and I was thinking, What is the lifetime of a controller class?
When does it get created? How many instances of a single controller are there? what are the implications of local variables? when is it destroyed?
I’m sure there is a good link somewhere floating around on the internet, but my google-fu couldn’t find it.
Stephen Walther has a great article on the life-cycle of a request being handled by the MVC Framework.
Here’s a extract from the top of his article, it goes on to explain each step in detail: