buzz 0.1.1
buzz: ^0.1.1 copied to clipboard
An opinionated scalable framework for modern mobile apps
example/README.md
Example #
Architecture Components #
Overview #
UiComponentlives inside aViewTemplate- A
ViewTemplateexposesCallbacks,ViewBuilders,Configsandattributes- A
Callback
- A
- A
Viewuse aViewTemplate - A
Pageuses aViewTemplateto bind theStateHolder, examples areViewControllerorViewModel - A
StateHolder- Listens to data streams from
Repositoriesin a read-only mode - Exposes processed and filtered information for the
Pageto inject into theView. - Could listen to
AppEventsand request moreCommandsexecution. For example using theNavigationCommandor theFeedbackCommandshould be common here.
- Listens to data streams from
- A
StateHoldertransformUiEvents(user interactions requesting something to our app) toUseCaseexecution requests. - A
UseCaseCommandorCommandrepresents the message to request business logic execution to start. - A
CommandHandleris the executioner of the business logic.- It has access to
Repositoriesto call WRITE async methods and wait for results to update all theDataProviderssupported by theRepository. For example, update local cache strategies or calling API services (which could be different if the use case requires it). - A
CommandHandleremitsAppEventswhich can be listen byStateHolders. - Q: Should the
CommandHandlerorchestrate saving data to a cache? Or should this be taken care by theRepository. Maybe theRepositoryis our champion approach.
- It has access to
- A
Repositoryis a facade forDataProvidersorDataSources.- The
Repositoryhandles data providers administration. SmartRepositiesalso handlesCache,Schedulers,Queuesimplementations 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
ModulaAbut imported and included onModuleBand 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
StateHoldercomponent
- 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.dartorpage.dart - I have a
routes.dart
Nested Features #
- A
featurehas its own folder with the name of the feature. Following dart packages conventions. - A
featurefolder uses the same naming convention of the section #base-files