Flow_of_Data_and_Processes en - umm/cafu_core GitHub Wiki
Data, Process flow
Consider the flow of data and processing with diagrams taken as an example of the implementation assumed at the time of actual development.
Events
Advance preparation
- Initialization processing
- Bind IInitializable with Zenject Installer to fire it
- UseCase gets Observable to notify the timing of projectile launch from Presenter
- Presenter gets Observable to notify the timing of bullet shot from View
- View returns an Observable which fires when clicked
- UseCase subscribes to the returned Observable and creates a bullet shooting method as a process on OnNext
Actual processing
- Screen tapped
- OnNext message flows to Observable for click notification of View
- Subscribed Observer.OnNext is executed in preparation
- Bullet shot process called
- UseCase instructs Presenter a bullet description
- Presenter instructs View to bullet drawing
- Bullets are rendered
Render server error in error dialog
Advance preparation
- Initialization processing
- Build Presentation Structure
- Connect Subject to notify communication result with server defined in Injected Entity to Structure's Observer
- Pass Structure from UseCase to Presenter
- Pass Structure from Presenter to View
- Subscribe to Observable in View and register processing at the time of error occurrence
Actual processing
- Process activation by some trigger
- Construct Data Structure for server query
- Connect Structure's Observable to Entity's Subject
- Pass Structure from UseCase to Repository
- Pass Structure from Repository to DataStore
- Query the server from the DataStore
- The server returns an error
- An OnError message flows to Observer of Structure
- A message flows to OnError which has already been subscribed in preparation
- An error dialog is rendered