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 TF
interface " " as SCF
interface " " as UIF
component "[EXTERNAL] IoT Devices" as IOT {
component "IoT Devices" as IOT {
interface " " as HDF
interface " " as HSF
interface " " as ZDF
interface " " as ZSF
[HomeKit smart device] as HD
[HomeKit smart sensor] as HS
[Zigbee smart device] as ZD
[Zigbee smart sensor] as ZS
[HomeKit smart device] as HD <<user provided>>
[HomeKit smart sensor] as HS <<user provided>>
[Zigbee smart device] as ZD <<user provided>>
[Zigbee smart sensor] as ZS <<user provided>>
HD--HDF
HS--HSF
@ -813,23 +812,38 @@ component "[EXTERNAL] IoT Devices" as IOT {
ZS--ZSF
}
[User Interface] as UI
component "User Interface" as UIC {
interface " " as WSCF
[User Interface] as UI
[WebSockets API (JavaScript)] <<external>> as WSC
WSCF)--UI
WSC--WSCF
}
component "Users and Devices" as DEV {
interface " " as DIDBF
interface " " as HAPF
interface " " as ZIGF
interface " " as WSSF
[HAP-java] as HAP
[zigbee4java] as ZIG
[HAP-java] as HAP <<external>>
[zigbee4java] as ZIG <<external>>
[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
HSF )-- HAP
ZDF )-- ZIG
ZSF )-- ZIG
DI--(WSSF
WSSF--WSS
HAP--HAPF
ZIG--ZIGF
HAPF )-- DI
@ -842,7 +856,7 @@ component "Triggers and Automations" as TRIG {
interface " " as TDBF
[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
T -( TDBF
@ -852,21 +866,19 @@ component "Scenes" as SCENE {
interface " " as SCDBF
[Scene Engine] as SC
[Scene DB <$database{scale=0.33}>] as SCDB
[Scene DB <$database{scale=0.33}> (PostgreSQL)] <<external>> as SCDB
SCDBF-SCDB
SC -( SCDBF
}
UIF--UI
DI--DIF
TF--T
SCF--SC
WSS <..> WSC: WebSocket protocol (RFC 6455)
DI --( TF
T --( SCF
DIF )-- SC
DI --( UIF
DIF )-- UI
UI --( SCF
UI --( TF
@ -877,6 +889,54 @@ skinparam defaultFontName Courier
@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