SCA Module structure

In SCA, a module has the following folder structure.

Configuration : Contains a JSON file. Modifications to the configuration record of the domain can be achieved using this.

JavaScript: Contains the entry point file, Router, Front end Model, Collection and View files

SuiteScript:  Contains the Backend model file and the service controller.

Templates: Contains the .tpl files with html code.

Sass: Contains the .scss files to style the html data

NetSuite Commerce uses Backbone for its site architecture, which results in a separation between the view (the presentation layer) and the model (the data layer). This is similar to the common model-view-controller (MVC) architecture, except that there isn’t a ‘controller’ in Backbone. Controller functions are split up, and are handled by the view and router. In general, however, this approach makes things easier to work with as you have one place where you put the logic of a module and another where you put what you want the user to see. Thus we end up with layering like this:

  1. Template (what shows the user data and captures it from them)
  2. View (what handles data to/from the template)
  3. Frontend model (what handles data to/from the view)
  4. Backend model (what handles data to/from the frontend model)
  5. NetSuite (where the data lives)

Leave a comment

Your email address will not be published. Required fields are marked *