Tina Chen
Tina Chen

Reputation: 2030

What is variant types in ui5?

In ui5 guidline, there is a variant types in naming conventions:

vVariant : variant types

What is the definition of it?

I find that in doc of MessageManager:

Param: vMessages

Type: sap.ui.core.message.Message or sap.ui.core.message.Message[]

Upvotes: 0

Views: 219

Answers (1)

n01dea
n01dea

Reputation: 1580

variant is a data type that does not declare a variable explicit. i.e. variant is to be used instead of other data types to handle data more flexible. i.e. vMessage can reference either to sap.ui.core.message.Message or sap.ui.core.message.Message[]. it can be variant 1. the sap.ui.core.message.Message object or it can be variant 2. the sap.ui.core.message.Message[] array. variant means that it can contain any data type: vVariable could contain any data type. sVariable is supposed to contain a string. oVariable is supposed to contain an object. in regard to the hungarian notation in javascript.

Upvotes: 1

Related Questions