Client script + UI Script + Script Include (Ajax) + Script Include (API)
Client script is a calling side. Optionally, it may be wrapped into a UI Script to form re-usable Client side API.
Script Include (Ajax) is an interface for client side interactions it fetches parameters, validate them and call necessary APIs.
Script Include (API) implements server side functionalities that may and most probably will be used by both Client and Server side logic. No Ajax parameters are available in context, they are supplied as method arguments.
Client script must describe the activity it performs.
UI Script forms a library of shared and re-usable functions. The name must point to the domain area it is related (D1imUtils) or functionality it contains (DateTimeUtils).
Script Include (Ajax) must be named according to the user interface it supports e.g. D1imCatalogItemAjax. The name must end with Ajax
suffix.
Script include (API) naming principle is similar to UI Script. It is also a library of shared and re-usable functions. Though, the use case of Script includes is much wider. So, there is no exact rule how to name them. Follow code convention guides from you team. Or at least common sense.
- Client script: On Group change
- UI Script: D1imUtils
- Script include (Ajax): D1imCatalogItemHelperAjax
- Script include: D1imCatalogItemHelper