Skip to main content
shark
Associate III
February 11, 2020
Question

mvp concept at custom container level

  • February 11, 2020
  • 4 replies
  • 1180 views

I have designed my small component as a custom wedget that will be embeded in many screens. This component need do some data interations with background system.

As document suggested, I would like to use MVP architecture to implement data exchanges. But I find that the presenter is at screen level, not the wedget level. So I have to re-transfer data through screen/view to it's internal componet? And I have to do it in every screen that used the component.

Can I do data exchanges at component level with MVP concept?

This topic has been closed for replies.

4 replies

Michael K
Senior III
February 11, 2020

"Because TouchGFX is implemented in C++ you have the option of taking advantage of object-oriented paradigms in your screens. If for instance all your screens need to display a status bar at the top, showing current time, battery level, et cetera you can create a base view class containing the status bar only and have all your views deriving from this class, so you get the status bar functionality automatically."

Source: https://touchgfx.zendesk.com/hc/en-us/articles/205717801-The-Screen-Concept-and-Model-View-Presenter

Embedded UI/UX Consulting: cadenza.design
Loppi
Associate III
October 24, 2022

Is there an updated link to this ressource?

Michael K
Senior III
October 24, 2022
shark
sharkAuthor
Associate III
February 12, 2020

Thank for your reply and I understand your method, it applies on small project only.

After I checked along the current data exchange path, I implemented another way, maybe helpful for someone else, that is.

For any comonent that need data interaction, it register a callback function onto the model when created and un-register it before destroy, model will call all the callbacks at tick event.

So every component can be more indepedent each other.