Ch2Weather first version
This commit is contained in:
38
Ch2Weather/Exercise1.mermaid
Normal file
38
Ch2Weather/Exercise1.mermaid
Normal file
@@ -0,0 +1,38 @@
|
||||
classDiagram
|
||||
class WeatherData {
|
||||
getTemperature()
|
||||
getHumidity()
|
||||
getPressure()
|
||||
measurementsChanged()
|
||||
|
||||
subscribe(observer: IWeatherObserver)
|
||||
unsubscribe(observer: IWeatherObserver)
|
||||
notify(data: WeatherRecord)
|
||||
}
|
||||
class WeatherRecord {
|
||||
f32 temperature
|
||||
f32 humidity
|
||||
f32 pressure
|
||||
}
|
||||
class IWeatherObserver {
|
||||
update(data: WeatherRecord)
|
||||
}
|
||||
class IWeatherSubject {
|
||||
subscribe(observer: IWeatherObserver)
|
||||
unsubscribe(observer: IWeatherObserver)
|
||||
notify(data: WeatherRecord)
|
||||
}
|
||||
class WeatherScreen1 {
|
||||
update(data: WeatherRecord)
|
||||
draw()
|
||||
}
|
||||
IWeatherSubject <|.. WeatherData
|
||||
IWeatherObserver <|.. WeatherScreen1
|
||||
IWeatherObserver <-- IWeatherSubject : observers
|
||||
WeatherData <-- WeatherScreen1 : Subjects
|
||||
IWeatherObserver .. IWeatherSubject
|
||||
class IDisplayElement {
|
||||
draw()
|
||||
}
|
||||
IDisplayElement <|.. WeatherScreen1
|
||||
|
||||
Reference in New Issue
Block a user