Component Naming Conventions
When building a solution that uses OneStream components—such as buttons, labels, combo boxes, and other UI elements—it’s crucial to maintain consistent naming. A clear naming convention enhances code readability, simplifies component identification, and streamlines collaboration across teams.
Best Practice: Prefixes in Naming
Use a three-character prefix followed by an underscore (_
) to indicate the component type. The remainder of the name should describe its specific purpose or role. This approach keeps the codebase organized and makes it easy to locate or update components.
For Example:
- Button:
btn_SaveData
- Label:
lbl_PropertyName
- Combo Box:
cbx_DatabaseList
This method keeps code bases organized and easy to navigate. When developers need to update, reference, or debug specific components, the prefix quickly identifies the type of element they are dealing with, improving efficiency.
Benefits of Naming Conventions
- Improved Readability: A descriptive prefix makes the component type obvious at a glance, so the code is easier to understand.
- Standardization: Consistent prefixes ensure everyone on the project follows the same structure, reducing confusion and errors.
- Faster Debugging: When troubleshooting, the prefix helps to quickly locate the relevant element, saving time when locating and modifying components.
- Enhanced Collaboration: A shared naming convention allows team members—whether frontend, backend, or QA—to work together more effectively, since everyone understands the format.
By following these best practices, we can ensure the code is well-structured, easy to maintain, and scalable.
Common OneStream Component Prefixes
Here is a list of common OneStream components and their three-character prefixes:
Component Name | Prefix |
---|---|
BI Viewer | biv |
Book Viewer | bvw |
Button | btn |
Chart | cht |
Check Box | chk |
Combo Box | cbx |
Cube Viewer | cvw |
Data Adapter | dat |
Data Explorer | dex |
Data Explorer Report | der |
Date Selector | dts |
Embedded Dashboard | emd |
File Viewer | fvw |
Filter Editor | fed |
Gantt View | gnv |
Grid View | grd |
Image | img |
List Box | lbx |
Label | lbl |
Large Data Pivot Grid | lpv |
Date Selector | dts |
Embedded Dashboard | emd |
File Viewer | fvw |
Filter Editor | fed |
Gantt View | gnv |
Grid View | grd |
Image | img |
List Box | lbx |
Label | lbl |
Large Data Pivot Grid | lpv |
Logo | lgo |
Map | map |
Member Tree | mmt |
Password Box | pwd |
Pivot Grid | pvg |
Radio Button Group | rbg |
Report | rpt |
Spreadsheet | spd |
Supplied Parameter | spp |
Text Box | txt |
Text Viewer | tvw |
Tree View | trv |
SQL Table Editor | ted |
Web Content | web |
State Indicator (windows app only) | sti |
Sankey Diagram (windows app only) | skd |