Application State

Why Trust Techopedia

What Does Application State Mean?

Application state, in the context of .NET, is a software construct that is usually accessed by way of the application property of the HttpContext object.

Advertisements

Application states usually store data in the form of nouns such as a person, place or thing, and present a key-value dictionary used to store these objects and variables. An application state class is created the very first time a URL resource is requested by any client and is often used by programmers as global variables visible by all clients in their sessions thereafter.

Application state may also be called HttpApplication state.

Techopedia Explains Application State

Browser activity in the form of HTTP requests and responses is inherently stateless – meaning that each page sent to a user’s browser does not know about other users who might be looking at the same page or even other pages the same user has accessed.

This can cause some difficulties when it comes to providing a useful experience to users on the Internet. For example, if a user requested the first page of 10 pages of data from a website there would most likely be a delay as the Web server goes out to a database to retrieve the information. The web application should be smart enough to recognize page 2 would most likely be requested by the user and take steps to provide this information quickly by storing it in a memory cache of the Web server. This would be hard to do without some means of creating and storing global variables – in this case, the cached data.

Application state provides this means of creating global variables that can be seen by all users.

One disadvantage to application state classes is that they can cause deadlock where one user’s activity can unknowingly try to update a variable at the same time another user is also doing so, or cause race conditions and access violations.

Despite this, using application state classes is worthwhile and can be used to provide a much better user experience for those browsing the Internet.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…