Giter VIP home page Giter VIP logo

Comments (6)

ubiratansoares avatar ubiratansoares commented on May 25, 2024

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.

ubiratansoares avatar ubiratansoares commented on May 25, 2024

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.

dbof10 avatar dbof10 commented on May 25, 2024

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.

ubiratansoares avatar ubiratansoares commented on May 25, 2024

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.

dbof10 avatar dbof10 commented on May 25, 2024
  1. 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
  2. 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 with BPresentation class from fragment A within the same Activity. It re-emits state from fragmentA to fragment B leading to ClassCastException

from norris.

lcszc avatar lcszc commented on May 25, 2024

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 with BPresentation class from fragment A within the same Activity. It re-emits state from fragmentA to fragment B leading to ClassCastException

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.