Comments (6)
your impl is quite hard to understand
@dbof10 I quite disagree : the implementation is straightforward. It says
When the interaction reports that user defined a query, trigger a command; otherwise, interpret the interaction, once it will generate a new ViewState
The reason behind separation between StateMachine and CommandsProcessor is : the first one broadcasts states
, the second one commands
(both consumed at the View level). Commands are intended to be handled at the View level without any changes on the current state; therefore, they are used (in the current implementation) to dispatch a navigation command to the View.
from norris.
I'm evaluating to unify both StateMachine and CommandsProcessor under a single abstraction and let the interpretation of the incoming "events" to be handled at the View level (therefore, the when
statement above would have a mirror in the View)
from norris.
So in which case, I will use processor
which case I let the machine consume the interaction
?
Another issue with this arch is how can I get current viewstate at a given time?
from norris.
So in which case, I will use processor which case I let the machine consume the interaction?
As I wrote above : commands (as far I see) don't change the UI state. Only states changes the UI state. Navigation is one usage for commands; other side effects are possible to fit in such design.
Another issue with this arch is how can I get current viewstate at a given time?
Sorry, why is this an "issue"?
And last, but not least : what is the use case for retrieving a particular ViewState?
from norris.
- Given I fetch a product from api, then I show it. When I click share, I need to create an intent with an image url in the product. This is the use case
- I just found out that this arch has a bug. Given a Activity with a fragment A with
APresentation
class, when I navigate to fragment B withBPresentation
class from fragment A within the same Activity. It re-emits state from fragmentA to fragment B leading toClassCastException
from norris.
Given I fetch a product from api, then I show it. When I click share, I need to create an intent with an image url in the product.
I think you can use the processor to trigger a command so the View can create the Intent. But you can also do it in the default way: View listen to OnClick event and then creates the Intent,
Check out FactsAdapter.
I just found out that this arch has a bug. Given a Activity with a fragment A with
APresentation
class, when I navigate to fragment B withBPresentation
class from fragment A within the same Activity. It re-emits state from fragmentA to fragment B leading toClassCastException
This project doesn't uses Fragment, mate. I've been testing it for a while and didn't found any problem within its navigation.
If you have changed its View to use Fragment instead maybe you did something wrong.
from norris.
Related Issues (14)
- Coding style HOT 2
- Add `UseCase` postfix HOT 1
- [QUESTION] Domain + UseCase + Livedata HOT 5
- Crash when I clicked "search" button HOT 1
- Dependency Dashboard
- Encrypt local files with age
- Re-introduce Leak Canary and shift-left memory leak detection
- Optimise storage usage driven by CI cache
- Investigate breaking changes with AGP 4.1.x
- Force Dependabot to sticky with major.minor.patch HOT 1
- Consider adopting Gradle java toolchains
- Manage CLI tooling on top of a asdf-compatible version manager
- Investigate breaking change with Kotlin 1.4.30
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from norris.