What is a stateless class (in asp.net) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The basic idea here is that your class only exists for the duration of the html request. After the request is processed, your class goes away.
State means that you “remember” things from one call to the next in class variables. Stateless means that you don’t.
It is certainly possible to store a class in the session and have it around for every page, but I gather that is not the situation discussed in the book.
EDIT:
An example of a stateful class might be one that increments a “pages visited” counter each time a page is loaded. That would not work unless you persist your class in the session.