Builder Pattern Components:
- Product: Session interface - defines the complex object being constructed.
- Concrete Product: HttpSession class - the specific implementation of the session.
- Builder: SessionBuilder interface - declares the construction steps.
- Concrete Builder: HttpSessionBuilder class - implements the construction steps for HTTP sessions.
- Director: SessionDirector class - controls the construction process and sequence.
┌───────────────────────────────┐
│ <<interface>> │
│ Session │ ← Product
├───────────────────────────────┤
│ + sendRequest(String): String │
└───────────────────────────────┘
△
│ implements
│
┌───────────────────────────────┐
│ HttpSession │ ← Concrete Product
├───────────────────────────────┤
│ + sendRequest(String): String │
└───────────────────────────────┘
┌─────────────────────────────┐
│ <<interface>> │
│ SessionBuilder │ ← Builder
├─────────────────────────────┤
│ + getSession(): Session │
│ + createSession(): void │
│ + configureSession(): void │
└─────────────────────────────┘
△
│ implements
│
┌─────────────────────────────┐
│ HttpSessionBuilder │ ← Concrete Builder
├─────────────────────────────┤
│ - session: Session │
│ + getSession(): Session │
│ + createSession(): void │
│ + configureSession(): void │
└─────────────────────────────┘
┌───────────────────────────────────┐
│ SessionDirector │ ← Director
├───────────────────────────────────┤
│ - sessionBuilder: SessionBuilder │
│ + SessionDirector(SessionBuilder) │
│ + build(): Session │
└───────────────────────────────────┘