Programming Terminology – Meaning of Context in Programming

terminology

I was looking through some Objective C docs.. and got this :

UIGraphicsBeginImageContext : Creates a bitmap-based graphics context
and makes it the current context.

Also, the same term is used in Robotlegs :

(http://www.adobe.com/devnet/actionscript/articles/intro-robotlegs-pt1.html)
Context: Context is the bootstrapping mechanism that initializes
dependency injection and the various core utilities that Robotlegs
uses.

Dictionary meaning of context as i googled, doesnot seem to match the way it's used in programming :

con·text /ˈkäntekst/ Noun
The circumstances that form the setting for an event, statement, or idea, and in terms of which it can be fully understood and
assessed.

The parts of something written or spoken that immediately precede and follow a word or passage and clarify its meaning.

Anybody can throw some light pls!

V.

Best Answer

The circumstances that form the setting for an event, statement, or idea, and in terms of which it can be fully understood and assessed.

That's really not too far from the programming sense of the word. Context generally has to do with some kind of state that's necessary to perform an operation.

A graphics context is typically an object or structure that contains all the information needed to draw in a particular place. Graphics contexts are often maintained in a stack, and any drawing operations happen using the information in the context at the top of the stack. A graphics context could contain information like the buffer in which to draw, current pen size, drawing color, background color, transformation matrix, pen location, and so on.

Similarly, you could have a database context, a file context, an audio context... none of these things are specifically defined outside the scope of a given API, but they all mean the same thing -- the set of conditions needed to properly carry out operations in the system in question.

Related Topic