Templates / classDiagram

Notification channel classes

A strategy pattern for pluggable notification channels (email, SMS, push) behind one interface.

Open in studio

Preview

Mermaid 11 renderer

Rendering preview...

Mermaid source

classDiagram

classDiagram
    class User {
        +int id
        +string email
        +NotificationPreference preference
    }
    class NotificationPreference {
        +bool emailEnabled
        +bool smsEnabled
        +bool pushEnabled
        +muteChannel(channel)
    }
    class NotificationChannel {
        <<interface>>
        +send(message)
    }
    class EmailChannel {
        +send(message)
    }
    class SmsChannel {
        +send(message)
    }
    class PushChannel {
        +send(message)
    }
    NotificationChannel <|.. EmailChannel
    NotificationChannel <|.. SmsChannel
    NotificationChannel <|.. PushChannel
    User "1" --> "1" NotificationPreference

More templates