Brief: modules
Modules and order
A module is a functionally complete part of a project: declarations of classes, properties, actions, forms, events, constraints (modules). One module is one .lsf file starting with a module header: MODULE, REQUIRE, PRIORITY, NAMESPACE.
REQUIRE lists the modules the current one depends on. The dependency is transitive, cycles are not allowed, and the initialization order is built from it: a module is initialized after all of its dependencies. Every module depends on the System module. The dependency also governs visibility: an element can only be found by name in a module that depends on it, so extending someone else's functionality is what the extension technique is for, see Brief: extensions.
A project is the set of modules and the accompanying files; by default every .lsf file on the application server's classpath is taken to be a module, and the logics.includePaths, logics.topModule and logics.orderDependencies launch parameters narrow that set and override the order.
Analogy: a package or an assembly.
MODULE Sale;
REQUIRE System, Utils, Item;
NAMESPACE Sale;
System modules
System modules are shipped with the platform — the standard library, which a project pulls in with REQUIRE and does not redefine (system modules). The platform loads twelve of them itself — System, Service, Reflection, Authentication, Security, SystemEvents, Email, Icon, Scheduler, Time, Utils, UserEvents — but being loaded is not being depended on: only System is an implicit dependency of every module, and a declaration from any of the others needs a REQUIRE.
| Module | What for |
|---|---|
System | root types, base classes, infrastructure |
Utils | general-purpose helper properties and actions |
Time | date and time properties and operations |
Authentication | users, contacts, sign-in |
Security | roles and access policies |
Service | service actions and server settings |
SystemEvents | server-lifecycle events |
UserEvents | programmatic access to a form's filters and orders |
Reflection | metadata about the navigator, forms, properties, tables |
Scheduler | scheduled actions |
Email | sending and receiving email |
Icon | UI icon catalogue |
Auxiliary modules: Backup, Chat, Eval, Excel, Document / Word, Image / OpenCV, I18n, Integration, MasterData, Numerator, Hierarchy, Historizable, Geo, Printer / QZTray / Sound / Com, ProcessMonitor / Profiler, RabbitMQ / WebSocket, Messenger with its Telegram / Slack / Viber / Whatsapp / Skype, SQLUtils, DefaultData, Schedule.
All of this is ordinary .lsf declarations, not language primitives: lpad, currentDate, currentUser are properties, and they should be searched for in the paradigm branch.