• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

J2EE has many APIs (EJB, JMS, JDBC, JNDI, Servlets, JSP, etc.). Students often memorize them as a random list. How do we organize them into a logical structure that shows relationships and purposes?

Core Idea

J2EE technologies can be grouped into 5 logical layers: Presentation/Web, Business Logic, Communication/Integration, Data/Persistence, and Foundation Services. This layered view shows how technologies relate and depend on each other.

Comparison by Layer

1. Presentation / Web Technologies (Client-Facing)

TechnologyPurposeKey Characteristic
ServletsHTTP request/response handlingJava classes, foundation of web tier
JSPDynamic HTML generationCompiles to servlets, HTML-centric

Relationship: JSP compiles to servlets. Both handle web requests but JSP separates UI from logic.

2. Business Logic Layer (The Brain)

TechnologyPurposeKey Characteristic
EJBServer-side business componentsContainer-managed services (transactions, security)

Relationship: EJB is the cornerstone of J2EE. Servlets/JSP often call EJBs for business logic.

3. Communication & Integration

TechnologyPurposeKey Characteristic
RMI-IIOPSynchronous distributed objectsOfficial J2EE remoting, CORBA-compatible
JMSAsynchronous messagingTwo domains: PTP (Queue) and Pub/Sub (Topic)
JCALegacy system integrationResource adapters for SAP, CICS, etc.
JAX-RPCWeb Services (SOAP)Two endpoint models (servlet or EJB-based)
Java IDLCORBA integrationCross-language communication

Relationship: RMI-IIOP is used by EJBs for remoting. JMS provides async alternative. JCA connects to legacy. JAX-RPC for web services.

4. Data & Persistence

TechnologyPurposeKey Characteristic
JDBCRelational database accessUniversal API, works with any RDBMS
JAXPXML parsingImplementation-neutral (DOM/SAX)

Relationship: EJBs often use JDBC for database access. JAXP for XML data in web services.

5. Foundation Services (Middleware)

TechnologyPurposeKey Characteristic
JNDINaming and directoryLocation transparency, unified API for all directories
JTA/JTSTransactionsDistributed transactions across resources
JAASSecurityPluggable authentication and authorization
JavaMailEmailPlatform-independent email sending

Relationship: JNDI is used by EJBs to look up resources. JTA provides transactions. JAAS provides security.

Visual Explanation

G cluster_presentation 1. Presentation/Web cluster_business 2. Business Logic cluster_comms 3. Communication/Integration cluster_data 4. Data/Persistence cluster_services 5. Foundation Services Servlets Servlets EJB EJB Servlets->EJB calls JSP JSP JSP->EJB calls RMI-IIOP RMI-IIOP EJB->RMI-IIOP uses JMS JMS EJB->JMS uses JDBC JDBC EJB->JDBC uses JNDI JNDI EJB->JNDI lookups JTA/JTS JTA/JTS EJB->JTA/JTS transactions JAAS JAAS EJB->JAAS security JCA JCA JAX-RPC JAX-RPC Java IDL Java IDL JAXP JAXP JavaMail JavaMail

Key Insights

  1. Layered dependency: Presentation → Business → Integration → Data, with Foundation Services supporting all layers
  2. EJB is central: Most technologies either support EJBs or are used by them
  3. Two communication paradigms: Synchronous (RMI-IIOP) vs Asynchronous (JMS)
  4. Modern equivalent: Spring Boot simplifies this by embedding many of these (Spring Data = JDBC, Spring Security = JAAS, etc.)
  5. Exam strategy: Group by layer, not alphabetically—shows understanding of architecture

Connections

Edge Cases & Gotchas

  • Overlap: Some technologies span layers (JNDI is used in web tier too)
  • Version differences: J2EE 1.4 vs Java EE 5+ have different API versions
  • Modern replacements: JAX-RPC → JAX-WS, Java IDL rarely used today
  • Spring alternative: Modern apps use Spring which abstracts many of these