hw7: done component diagram, wip on process diagram, todo ADRs

This commit is contained in:
Claudio Maggioni 2023-04-02 19:11:10 +02:00
parent e15557984b
commit 0821b085a1

View file

@ -794,18 +794,17 @@ title Smarthut.sm Logical View
interface " " as DIF interface " " as DIF
interface " " as TF interface " " as TF
interface " " as SCF interface " " as SCF
interface " " as UIF
component "[EXTERNAL] IoT Devices" as IOT { component "IoT Devices" as IOT {
interface " " as HDF interface " " as HDF
interface " " as HSF interface " " as HSF
interface " " as ZDF interface " " as ZDF
interface " " as ZSF interface " " as ZSF
[HomeKit smart device] as HD [HomeKit smart device] as HD <<user provided>>
[HomeKit smart sensor] as HS [HomeKit smart sensor] as HS <<user provided>>
[Zigbee smart device] as ZD [Zigbee smart device] as ZD <<user provided>>
[Zigbee smart sensor] as ZS [Zigbee smart sensor] as ZS <<user provided>>
HD--HDF HD--HDF
HS--HSF HS--HSF
@ -813,23 +812,38 @@ component "[EXTERNAL] IoT Devices" as IOT {
ZS--ZSF ZS--ZSF
} }
component "User Interface" as UIC {
interface " " as WSCF
[User Interface] as UI [User Interface] as UI
[WebSockets API (JavaScript)] <<external>> as WSC
WSCF)--UI
WSC--WSCF
}
component "Users and Devices" as DEV { component "Users and Devices" as DEV {
interface " " as DIDBF interface " " as DIDBF
interface " " as HAPF interface " " as HAPF
interface " " as ZIGF interface " " as ZIGF
interface " " as WSSF
[HAP-java] as HAP [HAP-java] as HAP <<external>>
[zigbee4java] as ZIG [zigbee4java] as ZIG <<external>>
[Device Engine] as DI [Device Engine] as DI
[User and Device DB <$database{scale=0.33}>] as DIDB
note left of DI: Already implemented using Spring Boot
[Spring WebSocket API] as WSS <<external>>
[User and Device DB <$database{scale=0.33}> (PostgreSQL)] <<external>> as DIDB
HDF )-- HAP HDF )-- HAP
HSF )-- HAP HSF )-- HAP
ZDF )-- ZIG ZDF )-- ZIG
ZSF )-- ZIG ZSF )-- ZIG
DI--(WSSF
WSSF--WSS
HAP--HAPF HAP--HAPF
ZIG--ZIGF ZIG--ZIGF
HAPF )-- DI HAPF )-- DI
@ -842,7 +856,7 @@ component "Triggers and Automations" as TRIG {
interface " " as TDBF interface " " as TDBF
[Trigger and Automation Engine] as T [Trigger and Automation Engine] as T
[Trigger and Automation DB <$database{scale=0.33}>] as TDB [Trigger and Automation DB <$database{scale=0.33}> (PostgreSQL)] <<external>> as TDB
TDBF-TDB TDBF-TDB
T -( TDBF T -( TDBF
@ -852,21 +866,19 @@ component "Scenes" as SCENE {
interface " " as SCDBF interface " " as SCDBF
[Scene Engine] as SC [Scene Engine] as SC
[Scene DB <$database{scale=0.33}>] as SCDB [Scene DB <$database{scale=0.33}> (PostgreSQL)] <<external>> as SCDB
SCDBF-SCDB SCDBF-SCDB
SC -( SCDBF SC -( SCDBF
} }
UIF--UI
DI--DIF DI--DIF
TF--T TF--T
SCF--SC SCF--SC
WSS <..> WSC: WebSocket protocol (RFC 6455)
DI --( TF DI --( TF
T --( SCF T --( SCF
DIF )-- SC DIF )-- SC
DI --( UIF
DIF )-- UI DIF )-- UI
UI --( SCF UI --( SCF
UI --( TF UI --( TF
@ -877,6 +889,54 @@ skinparam defaultFontName Courier
@enduml @enduml
``` ```
Use case: a user alters manually the state of device 'D' in the UI, and the device updates accordingly. Device 'D' is not part of any defined trigger.
```puml
@startuml
title Process View: UI updates state of device
box "IoT Devices"
participant "HomeKit dev." as HD
participant "HomeKit sens." as HS
participant "Zigbee dev." as ZD
participant "Zigbee sens." as ZS
end box
box "User Interface"
participant "UI" as UI
participant "WebSockets API (JS)" as WSC
end box
box "Users and Devices"
participant "HAP-java" as HAP
participant "zigbee4java" as ZIG
participant "Engine" as DI
participant "DB" as DIDB
participant "Spring WS API" as WSS
end box
box "Triggers and Automations"
participant "Engine" as T
participant "DB" as TDB
end box
box "Scenes"
participant "Engine" as SC
participant "DB" as SCDB
end box
UI -> DI: request state update
DI -> ZD: apply new state
ZD -> DI: report successful application
DI -> DIDB: store new state
DI -> UI: display new state
DI -> T: report latest device state
skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName Courier
@enduml
```
# Ex - Interface/API Specification # Ex - Interface/API Specification