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
```
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.

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.



