The difference between context and scope in CDI - and Java at all -


studying jsr-299, read section 5.1 of weld reference explains how scopes works in cdi. apparently, context concept closely related scope. have understood bit each 1 not separated in mind , feel tempted use words interchangeably.

what difference between scope , context? relationship between 2 concepts?

i expect answer in cdi domain doubt have java in general, since concepts used in other contexts well. actually, answer explains concepts in context of cdi, java and in general more points - if give them.

each scope has separate context.

the context container beans have been defined respective scope.

that's why context implementations carry name of scope - applicationcontext, dependentcontext, requestcontext, etc.

this implementation detail - user of cdi should know scopes (because define beans), , implementation decides place beans , how manage lifecycle.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -