• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

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

Semantic Network

graph semantic__Explicit_vs_Implicit_Middleware_ {
  layout=neato
  node [shape=ellipse fontname="Helvetica" fontsize=11 style=filled]
  THIS [label=""Explicit Vs Implici" fillcolor="#ffd700" fontsize=13 style="filled,bold"]
  REL1 [label="Related Concept" fillcolor="#f0f0f0"]
  REL2 [label="Builds Into" fillcolor="#d4edda"]
  THIS -- REL1 [label="related"]
  THIS -- REL2 [label="builds into"]
}

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)