It seems to me that a Context class is a control console whose object can invoke any included functions, such as Datacontext and DomainContext in WCF Ria service. Do I understan
A context is commonly a storage mechanism for a group of actions. HttpContext
, for example
Encapsulates all HTTP-specific information about an individual HTTP request.
For your WCF example, the "context" is the service. Different services have different contexts. Contexts can be as granular as you want. Some are broad, like the DomainContext
, and some are granular, like HttpContext
.
Contexts are everywhere, make them when you need to access or set like minded data or functions to things that can be decoupled.
All contexts are like this, they just encapsulate logic for particular action sets.
Here is another post describing the context design pattern.