Skip to Content
0

why use a model to interact with controls?

May 13 at 02:25 AM

52

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sharath M G May 13 at 12:29 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Sharath,

thank you for your helpful reply.

data transfer from from view to backend is a very good point.

some of our forms get rather complex and the thought of managing each control individually is not attractive.

cheers

pas.

0

I'm glad. Does it convince you to follow the MVC - model based design. ?

0