111 lines
3.7 KiB
Plaintext
111 lines
3.7 KiB
Plaintext
' ============================================================
|
||
' WALKGUIDE — DESIGN PATTERNS (GoF)
|
||
' Flutter × Spring Boot × In-Device AI
|
||
' Pattern 3 of 7: FACADE (Structural)
|
||
' ============================================================
|
||
|
||
@startuml WalkGuide_03_Facade
|
||
|
||
skinparam monochrome false
|
||
skinparam shadowing false
|
||
skinparam defaultFontName Arial
|
||
skinparam defaultFontSize 12
|
||
skinparam roundCorner 10
|
||
skinparam ArrowColor #555555
|
||
skinparam ArrowThickness 1.2
|
||
|
||
skinparam class {
|
||
BackgroundColor #FAFAFA
|
||
BorderColor #AAAAAA
|
||
HeaderBackgroundColor #E8E8E8
|
||
FontColor #222222
|
||
StereotypeFontColor #666666
|
||
AttributeFontColor #333333
|
||
}
|
||
|
||
skinparam package {
|
||
BackgroundColor #F5F5F5
|
||
BorderColor #888888
|
||
FontColor #333333
|
||
FontStyle bold
|
||
}
|
||
|
||
skinparam note {
|
||
BackgroundColor #FFFDE7
|
||
BorderColor #F9A825
|
||
FontColor #444444
|
||
FontSize 11
|
||
}
|
||
|
||
' ============================================================
|
||
' PATTERN 3 — FACADE (Structural) — Flutter
|
||
' ============================================================
|
||
|
||
package "③ Facade Pattern [Structural]" #FFF8E1 {
|
||
|
||
class "VoiceCommandHandler\n<<Facade>>" as VoiceCommandHandler {
|
||
- _ttsService : TtsService
|
||
- _sttService : SttService
|
||
- _router : CommandRouter
|
||
- _actions : Map<VoiceCommandKey, CommandAction>
|
||
+ processText(String command) : void
|
||
- _matchCommand(String) : VoiceCommandKey?
|
||
- _executeCommand(VoiceCommandKey) : void
|
||
}
|
||
|
||
class "WalkGuideCubit\n<<Client>>" as WalkGuideCubitFacade {
|
||
+ onVoiceCommand(String text)
|
||
}
|
||
|
||
class "GuardianDashboardService\n<<Facade>>" as GuardianDashboardService {
|
||
- _locationService : LocationService
|
||
- _activityService : ActivityLogService
|
||
- _sosService : SosService
|
||
- _notifService : NotificationService
|
||
+ getDashboard(guardianId) : DashboardResponse
|
||
}
|
||
|
||
class "SttService " as SttServiceFacade <<Subsystem>>
|
||
class "TtsService " as TtsServiceFacade <<Subsystem>>
|
||
class "CommandRouter\n<<Router Adapter>>" as GoRouterFacade <<Subsystem>>
|
||
class "CommandAction\n<<Cubit Callback>>" as CommandActionFacade <<Subsystem>>
|
||
|
||
class "LocationService\n<<Service>>" as LocationService <<Subsystem>>
|
||
class "ActivityLogService\n<<Service>>" as ActivityService <<Subsystem>>
|
||
class "SosService\n<<Service>>" as SosServiceFacade <<Subsystem>>
|
||
class "NotificationService\n<<Service>>" as NotifServiceFacade <<Subsystem>>
|
||
|
||
class "GuardianDashboardController\n<<Client>>" as GuardianDashboardController {
|
||
+ getDashboard(guardianId) : ResponseEntity
|
||
' GET /api/v1/guardian/dashboard
|
||
}
|
||
|
||
WalkGuideCubitFacade --> VoiceCommandHandler : processText()
|
||
VoiceCommandHandler --> SttServiceFacade : delegates
|
||
VoiceCommandHandler --> TtsServiceFacade : delegates
|
||
VoiceCommandHandler --> GoRouterFacade : delegates
|
||
VoiceCommandHandler --> CommandActionFacade : delegates
|
||
|
||
GuardianDashboardController --> GuardianDashboardService : getDashboard()
|
||
GuardianDashboardService --> LocationService : aggregates
|
||
GuardianDashboardService --> ActivityService : aggregates
|
||
GuardianDashboardService --> SosServiceFacade : aggregates
|
||
GuardianDashboardService --> NotifServiceFacade : aggregates
|
||
}
|
||
|
||
note right of VoiceCommandHandler
|
||
Client hanya panggil processText("start walkguide")
|
||
tanpa perlu tahu kompleksitas di baliknya:
|
||
matching phrase → execute command → TTS feedback
|
||
→ route navigation → BLoC event dispatch
|
||
end note
|
||
|
||
note right of GuardianDashboardService
|
||
Client (Controller) hanya panggil getDashboard(guardianId)
|
||
Facade mengagregasi 4 service sekaligus:
|
||
location + activity + SOS + notification
|
||
→ satu response, satu request dari Flutter
|
||
end note
|
||
|
||
@enduml
|