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

The Problem

Distributed applications need middleware services: security, transactions, threading, network communication. Who should write this code—the application developer or the infrastructure?

Core Idea

  • Explicit Middleware: Developer manually writes code for networking, security, threading. You control everything but spend 80% of your time on infrastructure.
  • Implicit Middleware: The EJB container automatically handles middleware services. Developer writes only business logic; the server manages security, transactions, and networking behind the scenes.

How It Works

AspectExplicit MiddlewareImplicit Middleware (EJB)
NetworkingDeveloper writes socket/RMI codeContainer generates stubs/skeletons
SecurityDeveloper checks permissions in codeContainer intercepts and checks roles
TransactionsDeveloper begins/commits transactionsContainer manages via deployment descriptor
ThreadingDeveloper manages thread poolsContainer manages bean pooling

Visual Explanation

MiddlewareComparison cluster_explicit Explicit Middleware cluster_implicit Implicit Middleware (EJB) ED Developer Code (Security + Network + Transactions + Business) S1 Server ED->S1 Manual setup BC Bean Provider Code (Only Business Logic) C EJB Container (Security + Network + Transactions + Pooling) BC->C S2 Server C->S2 Automatic

Key Properties

  • Implicit middleware = Productivity: Developer focuses on business value, not infrastructure
  • EJB Container is the implicit middleware provider: It intercepts calls and adds services
  • Declarative approach: In EJB, you declare requirements in ejb-jar.xml—container implements them
  • Vendor-specific: Each container provider (JBoss, WebLogic) implements the implicit middleware differently

Connections

Edge Cases & Gotchas

  • Debugging is harder with implicit middleware: When something fails, is it your code or the container?
  • Less control: You can’t fine-tune threading or connection pools—container decides
  • Vendor lock-in: Implicit middleware behavior varies across vendors (though standard APIs stay same)