Commerce Cloud Endless Aisle Naming Conventions

The Endless Aisle code uses common naming conventions. You should use descriptive names so that they can be easily found.

Configuration Names (Alloy.CFG)
  • Use underscores to name the configurations, for example: price_book, allow_simulate_payment
  • Some configuration names are shown in Business Manager so that the Alloy.CFG can be set up using the values in curly braces {}, for example: Session Timeout Dialog Display Time {session_timeout_dialog_display_time}
  • Limit the size of the configuration name; use comments for descriptions instead of long name
Controllers created in code, not with Require in view.xml
  • Alloy.createController calls set variable names as part of $. and uses camel case to distinguish from those created in view .xml files with underscores, for example: $.currentPage = Alloy.createController('components/controllerName');
Event Names
  • Use a colon to be more specific in event names, such as class:event
  • Use camel case for the class name
  • Ensure the class name matches the filename that fires them
Filenames
  • Use subdirectories to group files by area in the app, for example customer, checkout, and the like
  • Use index.js for the main view in the area
  • Use camel case for filenames, for example: controllers/checkout/components/allOverrideType
Styles (Alloy.Styles)
  • Use camel case naming convention, for example: Alloy.Styles.textFieldFont
Variable names
  • Avoid using single character variable names, even in event listeners
Views (.xml files)
  • Use underscores for id, accessibilityLabel and class names, for example: avs_popover_container

Related Links

Alloy Framework

UI View Types

Global Variables

Lifecycle for Views

Memory Management

Listener Types

Promises

Logging

App Configurations

Themes

Localization

Indentation