Skip to content

Commit

Permalink
Add the initial set of diagrams for the user statistics example #20
Browse files Browse the repository at this point in the history
  • Loading branch information
pintergreg committed Oct 2, 2024
1 parent 4a47b53 commit da9a27c
Show file tree
Hide file tree
Showing 15 changed files with 198 additions and 0 deletions.
55 changes: 55 additions & 0 deletions lectures/08_solid.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,61 @@ source [Wikipedia](https://en.wikipedia.org/wiki/Coupling_(computer_programming)
:::


# user statistics example

:::::::::::: {.columns}
::::::::: {.column width="55%" .pre-width-100}
`as a user I want to see my activity to see my progress`

display user statistics including

: - username
- profile image
- registration date
- progress in course
- daily activity in the current month


:::::::::
::::::::: {.column width="45%"}
![](figures/user_stats.drawio.svg){width=300}
:::::::::
::::::::::::


## architecture v1

:::::::::::: {.columns}
::::::::: {.column width="60%"}
![](figures/user_statistics/component_1.svg)
:::::::::
::::::::: {.column width="40%"}
send everything to the UI

![](figures/user_statistics/user_data.svg)

::: {.fragment}
in this case the UI has to calculate the daily activity
:::
:::::::::
::::::::::::


## architecture v2

:::::::::::: {.columns}
::::::::: {.column width="60%"}
![](figures/user_statistics/component_2.svg)
:::::::::
::::::::: {.column width="40%"}
send only the aggregated data

![](figures/user_statistics/user_data_light.svg)

:::::::::
::::::::::::


# references

::: {#refs}
Expand Down
46 changes: 46 additions & 0 deletions lectures/figures/user_statistics/class_1.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@startuml
skin rose

package database <<Database>> {
}

package UI {
class GUI {
drawProgressBar()
drawActivityMatrix()
loadProfilePicture()
calculateProgress()
calculateActivityMatrix()
}
}
package UserStatistics {
class UserData {
String name
Integer id
DateTime registration
List activities
}
class Activity {
DateTime timestamp
Integer lesson
Result result
}
Enum Result {
}
class DataCollector {
readUserDataFromDatabase()
sendData()
}
}

UserData -right- GUI
DataCollector -right-> GUI
Activity -right- GUI

Result --o Activity
UserData o-- Activity

DataCollector -- UserData

DataCollector -left- database
@enduml
1 change: 1 addition & 0 deletions lectures/figures/user_statistics/class_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions lectures/figures/user_statistics/component_1.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml
skin rose
package "user statistics" {
[UI]
[data collector]
}

[data collector]

database "database" {

}

[UI] <- [data collector]: sends user data
[data collector] --> [database]: read user data

@enduml
Loading

0 comments on commit da9a27c

Please sign in to comment.