A monitoring design has a temperature sensor and a door sensor. Both share a device ID. A class diagram can show that relationship without repeating the parent class.

```mermaid
classDiagram
    class Sensor {
        +String deviceId
    }
    Sensor <|-- TemperatureSensor
    Sensor <|-- DoorSensor
```

An example class diagram shows one Sensor class with two inheritance connections.

Example class structure. Show the shared parent once.

Verify where each triangle points

In a destination that renders Mermaid class diagrams, check that both hollow triangles touch Sensor. Read the first relationship as “TemperatureSensor is a kind of Sensor.” The second should say the same about DoorSensor.

A detail identifies the hollow triangle at the Sensor end of an inheritance connection.

Example render check. The triangle points toward the parent type.

If you reverse the order of the class names in the source, reverse the arrow notation too. Keep the shared field in the parent when the purpose is to show what the two subclasses have in common.

Mermaid’s class diagram and relationship reference.