Skip to content
Snippets Groups Projects
Commit f442ab4a authored by Ali Najafi's avatar Ali Najafi
Browse files

puml

parent c8e23610
No related branches found
No related tags found
No related merge requests found
cd.puml 0 → 100644
@startuml
interface SmartHomeMediator {
+notify(SmartDevice sender, string event)
}
class SmartDevice {
SmartHomeMediator mediator
+sendEvent(string event)
}
SmartDevice --> SmartHomeMediator : uses
SmartDevice ..|> SmartHomeMediator
class Light {
+turnOn()
+turnOff()
}
class Thermostat {
+setTemperature(int temp)
}
class SecuritySystem {
+arm()
+disarm()
}
class DoorLock {
+lock()
+unlock()
}
class Camera {
+startRecording()
+stopRecording()
}
class Speaker {
+playMusic()
+stopMusic()
}
class HomeMediator {
- Light light
- Thermostat thermostat
- SecuritySystem security
- DoorLock doorLock
- Camera camera
- Speaker speaker
+notify(SmartDevice sender, string event)
}
SmartHomeMediator <|.. HomeMediator
SmartDevice <|-- Light
SmartDevice <|-- Thermostat
SmartDevice <|-- SecuritySystem
SmartDevice <|-- DoorLock
SmartDevice <|-- Camera
SmartDevice <|-- Speaker
HomeMediator *-- Light : owns
HomeMediator *-- Thermostat : owns
HomeMediator *-- SecuritySystem : owns
HomeMediator *-- DoorLock : owns
HomeMediator *-- Camera : owns
HomeMediator *-- Speaker : owns
@enduml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment