0
votes

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[]

1
FYI: The naming conventions are part of the guidelines you have to follow if you contribute to the OpenUI5 framework. You don't have to follow them as an app developer if e.g. the customer has their own guideline.Boghyon Hoffmann
@boghyon, yes, I know that, thanks~ Since out team did not have guidline yet, I just use UI5 guideline for consistency~ And understand it makes more easy for me to read the API and source code.Tina Chen

1 Answers

1
votes

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.