Java – what is context object design pattern

design-patternsjava

what is context object design pattern ?

Best Answer

A Context is a collection of data, often stored in a Map or in a custom class which acts as a struct with accessors and modifiers. It is used for maintaining state and for sharing information within a system. See this PDF for an indepth description. Though it can be used for efficient and effective data sharing, you should note that many are wary of the Context pattern as an anti-pattern.