mendix / docs

Mendix documentation repository
https://docs.mendix.com
Creative Commons Attribution 4.0 International
139 stars 716 forks source link

Offline-First guide misses a microflow practice. #3474

Closed NicolasBRUNAUD closed 3 years ago

NicolasBRUNAUD commented 3 years ago

The Offline-first guide mentions that a microflow can be called from a nanoflow. But it comes with some strong limitations, that are seriously limiting the use of microflow with this approach, and prevent to implement any "online" capability.

The workaround is to trigger the microflows by an event during synchronization. This allows to pass persistable objects to the microflows, as inputs or ouputs. Of course, like any synchonization, the app will need to be online to be successful.

I think this practice should be part of the documentation.

Example : you want to implement a search functionality in a mobile app. 1-Create a persistable "SearchCriteria" persistable entity with an "after commit" event that calls a "PerformSearch" microflow. 2-on the mobile, create a "SearchCriteria" and synchronise it. 3-Synchronisation uploads the searchcriteria and commit it in server DB 4-the "PerformSearch" microflow is executed as an event, it attaches the results to the "SearchEntity" 5-Synchronization downloads the results

Adam-Dupaski commented 3 years ago

Thanks @NicolasBRUNAUD

Please verify this with the team @ConnorLand

ConnorLand commented 3 years ago

Will do @Adam-Dupaski .

ConnorLand commented 3 years ago

Hello @NicolasBRUNAUD,

I've had a chat with the development team about this. I'd like to pass along two key points of information:

  1. From the workaround and example you provided, the developers guess that you found pain points passing/returning persistable data to your microflows. Does that sound accurate? To address that point, we currently suggest the following in the Best Practices section of Offline-First: Use before- and after-commit microflows to pre- or post-process data. You may have already seen that text, but I just wanted to drop it here again in case.
  2. Stefanos and others are currently researching offline-first user patterns. That research will be turned into internal documentation, and then public-facing external documentation. Stefanos has added a link from this GitHub issue to his research so that he can keep it in mind when improving technology. I will keep it in mind as I hone documentation.

I can keep this issue open, or I can copy/paste your pattern into Stefanos' research doc. Either way, rest assured that future improvements to tech and docs will improve this pain point you've identified. Thank you.

NicolasBRUNAUD commented 3 years ago

Thanks for the response, I appreciate. You're right, I realize now that it's already mentioned in the best practice.  I still think that it deserves more exposure. You're understanding is correct, passing /returning is technically the limitation that we can workaround with this practice, and by extension, I think that any online functionality requires to pass or return objects. The need for such functionality comes very early in development process and we should teach this practice in the guide, and even in the learning path, because "offline first" doesn't mean "offline only". Have a great weekend! Envoyé depuis mon appareil Galaxy -------- Message d'origine --------De : ConnorLand @.> Date : 25/06/2021 15:34 (GMT+01:00) À : mendix/docs @.> Cc : NicolasBRUNAUD @.>, Mention @.> Objet : Re: [mendix/docs] Offline-First guide misses a microflow practice. (#3474) Hello @NicolasBRUNAUD, I've had a chat with the development team about this. I'd like to pass along two key points of information:

From the workaround and example you provided, the developers guess that you found pain points passing/returning persistable data to your microflows. Does that sound accurate? To address that point, we currently suggest the following in the Best Practices section of Offline-First: Use before- and after-commit microflows to pre- or post-process data. You may have already seen that text, but I just wanted to drop it here again in case. Stefanos and others are currently researching offline-first user patterns. That research will be turned into internal documentation, and then public-facing external documentation. Stefanos has added a link from this GitHub issue to his research so that he can keep it in mind when improving technology. I will keep it in mind as I hone documentation.

I can keep this issue open, or I can copy/paste your pattern into Stefanos' research doc. Either way, rest assured that future improvements to tech and docs will improve this pain point you've identified. Thank you.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

ConnorLand commented 3 years ago

I have noted the need for more explicit descriptions of pass/return functionality in Stefanos' Offline-First research doc. We want to make sure we are teaching our customers best practices in a quick, straightforward way.

We will make sure the docs and learning paths receive upgrades this quarter when Stefanos' research is implemented.