# gauharb/sdp-asn3 architecture

> Architecture diagram of the GitHub repository gauharb/sdp-asn3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gauharb/sdp-asn3
- Repository: https://github.com/gauharb/sdp-asn3

## Overview

This small Java example demonstrates bridge-based notifications. The demo client creates reminders or urgent alerts, selects a delivery channel, executes the notification, and checks the returned delivery string; it also switches a channel without replacing the notification object. Notification owns the bridge dispatch to channel formatting and delivery, while each notification subtype builds its own content and each channel formats and labels its result. The graph follows the README role map and sampled sources.

Main entry points: [`src/Main.java`](https://github.com/gauharb/sdp-asn3/blob/main/src/Main.java) (Demo runner), [`src/Notification.java`](https://github.com/gauharb/sdp-asn3/blob/main/src/Notification.java) (Notification bridge), [`src/Channel.java`](https://github.com/gauharb/sdp-asn3/blob/main/src/Channel.java) (Channel contract), [`src/EmailChannel.java`](https://github.com/gauharb/sdp-asn3/blob/main/src/EmailChannel.java) (Email channel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notification["Notification types"]
  node_notification["Notification bridge<br/>[Notification.java]"]
  node_reminder["Reminder<br/>[Reminder.java]"]
  node_urgent["Urgent alert<br/>[UrgentAlert.java]"]
end

subgraph group_delivery["Delivery channels"]
  node_channel["Channel contract<br/>[Channel.java]"]
  node_email["Email channel<br/>[EmailChannel.java]"]
  node_sms["SMS channel<br/>[SmsChannel.java]"]
  node_push["Push channel<br/>[PushChannel.java]"]
end

subgraph group_demo["Demo client"]
  node_main["Demo runner<br/>[Main.java]"]
end

node_user(("CLI user"))

node_user -->|"runs demo"| node_main
node_main -->|"creates and executes"| node_reminder
node_main -->|"creates and executes"| node_urgent
node_main -->|"selects channel"| node_email
node_main -->|"selects channel"| node_sms
node_main -->|"selects channel"| node_push
node_main -->|"switches implementation"| node_notification
node_notification -->|"dispatches content build"| node_reminder
node_notification -->|"dispatches content build"| node_urgent
node_notification -->|"formats and delivers"| node_channel
node_email -->|"implements"| node_channel
node_sms -->|"implements"| node_channel
node_push -->|"implements"| node_channel

click node_main "https://github.com/gauharb/sdp-asn3/blob/main/src/Main.java"
click node_notification "https://github.com/gauharb/sdp-asn3/blob/main/src/Notification.java"
click node_reminder "https://github.com/gauharb/sdp-asn3/blob/main/src/Reminder.java"
click node_urgent "https://github.com/gauharb/sdp-asn3/blob/main/src/UrgentAlert.java"
click node_channel "https://github.com/gauharb/sdp-asn3/blob/main/src/Channel.java"
click node_email "https://github.com/gauharb/sdp-asn3/blob/main/src/EmailChannel.java"
click node_sms "https://github.com/gauharb/sdp-asn3/blob/main/src/SmsChannel.java"
click node_push "https://github.com/gauharb/sdp-asn3/blob/main/src/PushChannel.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_notification,node_reminder,node_urgent,node_user toneBlue
class node_channel,node_email,node_sms,node_push toneAmber
class node_main toneMint
```

## Components

### Notification types

- [Notification bridge](https://github.com/gauharb/sdp-asn3/blob/main/src/Notification.java): `src/Notification.java`
- [Reminder](https://github.com/gauharb/sdp-asn3/blob/main/src/Reminder.java): `src/Reminder.java`
- [Urgent alert](https://github.com/gauharb/sdp-asn3/blob/main/src/UrgentAlert.java): `src/UrgentAlert.java`

### Delivery channels

- [Channel contract](https://github.com/gauharb/sdp-asn3/blob/main/src/Channel.java): `src/Channel.java`
- [Email channel](https://github.com/gauharb/sdp-asn3/blob/main/src/EmailChannel.java): `src/EmailChannel.java`
- [SMS channel](https://github.com/gauharb/sdp-asn3/blob/main/src/SmsChannel.java): `src/SmsChannel.java`
- [Push channel](https://github.com/gauharb/sdp-asn3/blob/main/src/PushChannel.java): `src/PushChannel.java`

### Demo client

- [Demo runner](https://github.com/gauharb/sdp-asn3/blob/main/src/Main.java): `src/Main.java`

### Other components

- **CLI user**

## Connections

- CLI user → Demo runner: runs demo (evidence: `ReadMe`)
- Demo runner → Reminder: creates and executes (evidence: `src/Main.java`)
- Demo runner → Urgent alert: creates and executes (evidence: `src/Main.java`)
- Demo runner → Email channel: selects channel (evidence: `src/Main.java`)
- Demo runner → SMS channel: selects channel (evidence: `src/Main.java`)
- Demo runner → Push channel: selects channel (evidence: `src/Main.java`)
- Demo runner → Notification bridge: switches implementation (evidence: `src/Main.java`)
- Notification bridge → Reminder: dispatches content build (evidence: `src/Notification.java`)
- Notification bridge → Urgent alert: dispatches content build (evidence: `src/Notification.java`)
- Notification bridge → Channel contract: formats and delivers (evidence: `src/Notification.java`)
- Email channel → Channel contract: implements (evidence: `src/EmailChannel.java`)
- SMS channel → Channel contract: implements (evidence: `src/SmsChannel.java`)
- Push channel → Channel contract: implements (evidence: `src/PushChannel.java`)
