JEE Core Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
* [[JEE#Subjects|JEE]]
* [[JEE#Subjects|JEE]]


=Changing Application Behavior without Changing Code=
=Resources, Naming and Injection=
 
 
 
Changing Application Behavior without Changing Code


The possibility to change an application's behavior without changing code is a core concern in JEE. The entire Chapter 5 in the [[JEE#jsr_316|JEE specifications]] is dedicated to it.  
The possibility to change an application's behavior without changing code is a core concern in JEE. The entire Chapter 5 in the [[JEE#jsr_316|JEE specifications]] is dedicated to it.  
Line 10: Line 14:


The application code uses ENC ''named entries'' to refer to configuration values and external resources. The names of those elements do not change in the code, and those names are mapped to deployment environment specific values and resources during deployment. The use of ''deployment descriptors'' is essential part of the mapping. The deployment descriptors act as a layer of indirection between code and the deployment environment, and provide the mappings mentioned above. The code does not change, but the deployment descriptors do.
The application code uses ENC ''named entries'' to refer to configuration values and external resources. The names of those elements do not change in the code, and those names are mapped to deployment environment specific values and resources during deployment. The use of ''deployment descriptors'' is essential part of the mapping. The deployment descriptors act as a layer of indirection between code and the deployment environment, and provide the mappings mentioned above. The code does not change, but the deployment descriptors do.
=TODO=
<font color=red>
* Review [[WildFly JNDI Concepts]].
* Review [[@javax.annotation.Resource]]
* Review [[EJB_Annotations#.40javax.ejb.EJB]]
</font>

Revision as of 03:59, 7 April 2017

Internal

Resources, Naming and Injection

Changing Application Behavior without Changing Code

The possibility to change an application's behavior without changing code is a core concern in JEE. The entire Chapter 5 in the JEE specifications is dedicated to it.

The essential mechanism than makes this possible is the application component environment, also known as enterprise naming context or ENC. ENC is a JNDI naming context, accessible to and private for each application component.

The application code uses ENC named entries to refer to configuration values and external resources. The names of those elements do not change in the code, and those names are mapped to deployment environment specific values and resources during deployment. The use of deployment descriptors is essential part of the mapping. The deployment descriptors act as a layer of indirection between code and the deployment environment, and provide the mappings mentioned above. The code does not change, but the deployment descriptors do.

TODO