buzz 0.1.1 buzz: ^0.1.1 copied to clipboard
An opinionated scalable framework for modern mobile apps
Example #
Architecture Components #
Overview #
UiComponent
lives inside aViewTemplate
- A
ViewTemplate
exposesCallbacks
,ViewBuilders
,Configs
andattributes
- A
Callback
- A
- A
View
use aViewTemplate
- A
Page
uses aViewTemplate
to bind theStateHolder
, examples areViewController
orViewModel
- A
StateHolder
- Listens to data streams from
Repositories
in a read-only mode - Exposes processed and filtered information for the
Page
to inject into theView
. - Could listen to
AppEvents
and request moreCommands
execution. For example using theNavigationCommand
or theFeedbackCommand
should be common here.
- Listens to data streams from
- A
StateHolder
transformUiEvents
(user interactions requesting something to our app) toUseCase
execution requests. - A
UseCaseCommand
orCommand
represents the message to request business logic execution to start. - A
CommandHandler
is the executioner of the business logic.- It has access to
Repositories
to call WRITE async methods and wait for results to update all theDataProviders
supported by theRepository
. For example, update local cache strategies or calling API services (which could be different if the use case requires it). - A
CommandHandler
emitsAppEvents
which can be listen byStateHolders
. - Q: Should the
CommandHandler
orchestrate saving data to a cache? Or should this be taken care by theRepository
. Maybe theRepository
is our champion approach.
- It has access to
- A
Repository
is a facade forDataProviders
orDataSources
.- The
Repository
handles data providers administration. SmartReposities
also handlesCache
,Schedulers
,Queues
implementations to provide more complex logic for data access.
- The
TODO:
- ❌ Change Page to Screen?
- ❌ Find a way to justify having Page -> View (ViewTemplate + StateHolder) maybe eventually Page = View + PageController where the controller can access to feature flags.
- ❌ How can we create sharable components between feature modules. Meaning a Component could be part of
ModulaA
but imported and included onModuleB
and have the same behavior out of the box. How feature flags could work at this level.
From Atomic Design guides:
- ViewTemplate consist mostly of groups of UiComponent stitched together to form pages.
- Pages are specific instances of templates
Presentation #
Domain #
UseCaseCommand
- Generated from a
StateHolder
component
- Generated from a
UseCaseCommandHandler
- Fires
AppEvents
- Fires
Data #
Architecture Components Checklist #
Base Files #
- I have a
template.dart
- I have a
view.dart
- I have a
screen.dart
orpage.dart
- I have a
routes.dart
Nested Features #
- A
feature
has its own folder with the name of the feature. Following dart packages conventions. - A
feature
folder uses the same naming convention of the section #base-files