From 3fb5b81ef2c08e746f11ad941abb535f8f1fb867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kamo=C5=84?= Date: Fri, 23 Apr 2021 10:58:27 +0200 Subject: [PATCH] [EGD-6602] Add documentation for home notifications Documentation providers class structure diagrams for realization of MVP pattern in context of home screen notifications. --- module-apps/notifications/README.md | 27 ++++++++++ .../notifications_model_owner_structure.puml | 28 ++++++++++ .../notifications_model_owner_structure.svg | 40 ++++++++++++++ .../doc/notifications_model_structure.puml | 38 ++++++++++++++ .../doc/notifications_model_structure.svg | 51 ++++++++++++++++++ .../notifications_mvp_general_overview.puml | 39 ++++++++++++++ .../notifications_mvp_general_overview.svg | 52 +++++++++++++++++++ ...otifications_provider_owner_structure.puml | 35 +++++++++++++ ...notifications_provider_owner_structure.svg | 48 +++++++++++++++++ .../doc/notifications_provider_structure.puml | 27 ++++++++++ .../doc/notifications_provider_structure.svg | 40 ++++++++++++++ 11 files changed, 425 insertions(+) create mode 100644 module-apps/notifications/README.md create mode 100644 module-apps/notifications/doc/notifications_model_owner_structure.puml create mode 100644 module-apps/notifications/doc/notifications_model_owner_structure.svg create mode 100644 module-apps/notifications/doc/notifications_model_structure.puml create mode 100644 module-apps/notifications/doc/notifications_model_structure.svg create mode 100644 module-apps/notifications/doc/notifications_mvp_general_overview.puml create mode 100644 module-apps/notifications/doc/notifications_mvp_general_overview.svg create mode 100644 module-apps/notifications/doc/notifications_provider_owner_structure.puml create mode 100644 module-apps/notifications/doc/notifications_provider_owner_structure.svg create mode 100644 module-apps/notifications/doc/notifications_provider_structure.puml create mode 100644 module-apps/notifications/doc/notifications_provider_structure.svg diff --git a/module-apps/notifications/README.md b/module-apps/notifications/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b247233bcbc8c5f53b2b7d8a1c6299f3b818aa68 --- /dev/null +++ b/module-apps/notifications/README.md @@ -0,0 +1,27 @@ +# Home Screen Notifications + +## General structure +The general structure is based on the `Model-View` pattern on the front-end, supplied with a `Provider`'s back-end notifications as follows: + +![](doc/notifications_mvp_general_overview.svg) + +## Provider structure + +On the provider's end, `Notifications` are managed by `NotificationProvider` and sent as an `NotificationsChanged` action with `NotificationsChangedParams` via `ApplicationManger`'s `Controller`. + +![](doc/notifications_provider_owner_structure.svg) + +The `NotificationProvider` is responsible for creating and managing `Notifications`. Each `Notification` represents a unique +event and thus at most single object (of a respective type) can be stored in the provider. The provider's structure is shown on following diagram: + +![](doc/notifications_provider_structure.svg) + +## Model-View structure + +![](doc/notifications_model_owner_structure.svg) + +`NotificationsModel` is responsible for creating and decorating `NotificationListItem`s based on `NotificationsChangedParams` received. +The model serves also as a local provider for `gui::ListView`. + +![](doc/notifications_model_structure.svg) + diff --git a/module-apps/notifications/doc/notifications_model_owner_structure.puml b/module-apps/notifications/doc/notifications_model_owner_structure.puml new file mode 100644 index 0000000000000000000000000000000000000000..24c8fc8fc6bb12da1ed3aba1b07d2ee170ed613f --- /dev/null +++ b/module-apps/notifications/doc/notifications_model_owner_structure.puml @@ -0,0 +1,28 @@ +@startuml + +skinparam linetype ortho +skinparam nodesep 100 + +class "NotificationsModel" as model +class ListView + +node "Owner Window" as owner { + class AppWindow + class "WindowWithNotifications" as notifWindow + + AppWindow <|-- notifWindow +} + +ListView -[hidden]- owner +model -[hidden]r- owner + +notifWindow "create"*..>ListView +ListView "use"-u-->model +notifWindow *-->model +model "use"--> AppWindow + + + + +@enduml + diff --git a/module-apps/notifications/doc/notifications_model_owner_structure.svg b/module-apps/notifications/doc/notifications_model_owner_structure.svg new file mode 100644 index 0000000000000000000000000000000000000000..839d0bc6d2c0991a85c3d09200f3c1a0d6ee0d9f --- /dev/null +++ b/module-apps/notifications/doc/notifications_model_owner_structure.svg @@ -0,0 +1,40 @@ +Owner WindowAppWindowWindowWithNotificationsNotificationsModelListViewcreateuseuse \ No newline at end of file diff --git a/module-apps/notifications/doc/notifications_model_structure.puml b/module-apps/notifications/doc/notifications_model_structure.puml new file mode 100644 index 0000000000000000000000000000000000000000..49363facfc65078901c60bb3308ae6bea53d2a63 --- /dev/null +++ b/module-apps/notifications/doc/notifications_model_structure.puml @@ -0,0 +1,38 @@ +@startuml + +skinparam linetype ortho + +node "GUI Model View Porvider" { + class ListItem + class ListView + class InternalModel + class Provider + + ListView "use"-l--> Provider + ListView "use"--> ListItem +} +class "NotificationsChangedParams" as params + +node "Notification ListItems"{ + class "NotificationListItem" as notifLI + class "NotificationWithEventCounter" as notifCounter + class "NotificationWithOnOffButton" as notifButton + + notifLI <|-- notifCounter + notifLI <|-- notifButton +} + +node "Notifications Model"{ + class "NotificationsModel" as model +} + +model "create"*..-> notifLI +model "use"-d--> params + +Provider <|-- model +InternalModel <|-- model +ListItem <|-- notifLI + + + +@enduml diff --git a/module-apps/notifications/doc/notifications_model_structure.svg b/module-apps/notifications/doc/notifications_model_structure.svg new file mode 100644 index 0000000000000000000000000000000000000000..efd7afa3cd1480c3b7f3aeaf3d9a1f0f03f59d86 --- /dev/null +++ b/module-apps/notifications/doc/notifications_model_structure.svg @@ -0,0 +1,51 @@ +GUI Model View PorviderNotification ListItemsNotifications ModelListItemListViewInternalModelProviderNotificationListItemNotificationWithEventCounterNotificationWithOnOffButtonNotificationsModelNotificationsChangedParamsuseusecreateuse \ No newline at end of file diff --git a/module-apps/notifications/doc/notifications_mvp_general_overview.puml b/module-apps/notifications/doc/notifications_mvp_general_overview.puml new file mode 100644 index 0000000000000000000000000000000000000000..25a8c560916bcfabf41a4bdc8476c30638273822 --- /dev/null +++ b/module-apps/notifications/doc/notifications_mvp_general_overview.puml @@ -0,0 +1,39 @@ +@startuml +skinparam linetype ortho + +node "Provider" as provider { + class "NotificationProvider" as notProvider +} +node "Model" as model{ + class "NotificationsModel" as notModel{ + {method} update(NotificationsChangedParams *) + } + interface "gui::Provider" as guiProv +} +node View { + class ListView +} +class "NotificationListItem" as item +class "NotificationsChangedParams" as params +interface "APM Controller" as system { + {method} sendAction(...) +} + +notProvider "use"--> params +notModel "use"-->params +notModel "use"-->item +ListView "use"-->item + +guiProv <|-r-- notModel +ListView "use"-->guiProv +guiProv "use"-->ListView + + +notProvider "use"-d-->system +system "use"--> notModel + +model -[hidden]r- View +model -[hidden]d- notProvider + + +@enduml diff --git a/module-apps/notifications/doc/notifications_mvp_general_overview.svg b/module-apps/notifications/doc/notifications_mvp_general_overview.svg new file mode 100644 index 0000000000000000000000000000000000000000..a69ee760c13005396162a9942ce3901f3056c3cb --- /dev/null +++ b/module-apps/notifications/doc/notifications_mvp_general_overview.svg @@ -0,0 +1,52 @@ +ProviderModelViewNotificationProviderNotificationsModelupdate(NotificationsChangedParams *)gui::ProviderListViewNotificationListItemNotificationsChangedParamsAPM ControllersendAction(...)useuseuseuseuseuseuseuse \ No newline at end of file diff --git a/module-apps/notifications/doc/notifications_provider_owner_structure.puml b/module-apps/notifications/doc/notifications_provider_owner_structure.puml new file mode 100644 index 0000000000000000000000000000000000000000..2ca2bb2fb459ef54dce2de9a258893139605a924 --- /dev/null +++ b/module-apps/notifications/doc/notifications_provider_owner_structure.puml @@ -0,0 +1,35 @@ +@startuml + skinparam linetype ortho +node "OwnerService" as owner{ + class "ApplicationManager" as apm + class "APMController" as controller{ + {method} sendAction(...) + } + abstract "sys::Service" as serv + serv <|-u-- apm + controller "use"-d--> apm +} + +class "ActionsParams" as params + +node "Provider" as provider { + class "NotificationProvider" as notProvider { + {field} ownerService * + {method} handle(...) + {method} send() + {method} requestNotSeenNotifications() + } + class "NotificationsChangedParams" as notifParams + notProvider -l..>notifParams +} + +provider -[hidden]d- owner + +notProvider "use"--> serv +notProvider "use"--> controller +params "use"<-- controller +notifParams --|>params +apm "creates"..>notProvider + + +@enduml diff --git a/module-apps/notifications/doc/notifications_provider_owner_structure.svg b/module-apps/notifications/doc/notifications_provider_owner_structure.svg new file mode 100644 index 0000000000000000000000000000000000000000..cb7aadf754983acd34202ebed0a95b859e1ee35c --- /dev/null +++ b/module-apps/notifications/doc/notifications_provider_owner_structure.svg @@ -0,0 +1,48 @@ +OwnerServiceProviderApplicationManagerAPMControllersendAction(...)sys::ServiceNotificationProviderownerService *handle(...)send()requestNotSeenNotifications()NotificationsChangedParamsActionsParamsuseuseuseusecreates \ No newline at end of file diff --git a/module-apps/notifications/doc/notifications_provider_structure.puml b/module-apps/notifications/doc/notifications_provider_structure.puml new file mode 100644 index 0000000000000000000000000000000000000000..1e07a940b87d5e81ddb338d1381ea0bb3eb64bfb --- /dev/null +++ b/module-apps/notifications/doc/notifications_provider_structure.puml @@ -0,0 +1,27 @@ +@startuml +skinparam linetype ortho + +node "Notifications" as notifs { + class "Notification" as notif + + class "ConcreteNotification_A" as smsNotif + class "ConcreteNotification_B" as callNotif + + notif <|-u-- smsNotif + notif <|-u-- callNotif +} + +node "Provider" as provider { + class "NotificationProvider" as notProvider + class "NotificationsChangedParams" as params + notProvider -u..>params +} + + +notProvider "0..1"..> smsNotif +notProvider "0..1"..> callNotif +notProvider *-- notif + +params *-->notif + +@enduml diff --git a/module-apps/notifications/doc/notifications_provider_structure.svg b/module-apps/notifications/doc/notifications_provider_structure.svg new file mode 100644 index 0000000000000000000000000000000000000000..c9c57025ae0757a0c861063514f2e91b43349a46 --- /dev/null +++ b/module-apps/notifications/doc/notifications_provider_structure.svg @@ -0,0 +1,40 @@ +NotificationsProviderNotificationConcreteNotification_AConcreteNotification_BNotificationProviderNotificationsChangedParams0..10..1 \ No newline at end of file