Skip to Content

why use a model to interact with controls?

hello,

i was having a chat with some one learning UI5 and they asked we should use a model to interact with a control rather than doing it directly.

after much thinking all i could come up with was 'just because' - which is not a very good answer.

so, why use a model instead of directly addressing a control (by its id)?

cheers

pas.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 13 at 12:29 PM

    Coz, ID may change? so, id is not always reliable to get and set its data.

    Also, if you want to transfer data to the backend service, getting data individually frome ach control is not godo for performance.

    Model, conforms to the Model view controller paradigm, which has its advantages - which is well documented.

    The biggest benefit(in my view) is that model supports, data binding and mapping, which facilitates the seamless data transfer from view to the backend.

    Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded