Libraries¶
The libraries are what let a single line of Mamba do a large piece of work: send an e-mail, read an Excel file, sign in a user, write a log. They are built into zAppDev and available in every Mamba operation by name, with no setup and no imports.
DebugLib.Logger.WriteInfoLine("Import started");
var user = AppLib.Session.GetCurrentUser();
bool allowed = AppLib.Security.CurrentUserHasPermission("ManageUsers");
Each library has a reference page with its classes, methods, parameters and examples. The pages are generated from the libraries themselves, so they list exactly what is available.
The libraries¶
| Library | Use it for | Main classes |
|---|---|---|
| Standard Library | The core types and their methods: text, numbers, dates, collections, exceptions. | string, int, decimal, DateTime, Collection, Dictionary, Array, BusinessException |
| Domain Library | The operations every business object class gets automatically. | Save, Delete, Find, GetAll, GetByKey, Create, Copy |
| AppLib | The running application: the session and current user, security and permissions, caching, errors and messages. | Session, Security, ApplicationCache, Globalization, MessageType |
| CommonLib | General utilities: e-mail, data access, math, serialization, CSV, paging, SFTP, tokens. | Utilities, DataContext, Math, Serializer, CsvParser, EmailMessage, SFTPClient, Stopwatch |
| DebugLib | Writing to the application log. | Logger |
| FileIOLib | Files, folders, paths and zip archives on the server. | File, Directory, Path, ZipFile |
| ExcelLib | Reading, creating and exporting Excel workbooks. | ExcelHelper, ExcelPackage, ExcelStyle |
| PDFLib | Building PDF documents in code. | DocumentBuilder, Document, Section, Table, Paragraph |
| XmlLib | Reading and writing XML. | XmlDocument, XmlElement |
| RegExpLib | Pattern matching with readable expressions. | VerbalExpressions |
| WebLib | Web addresses, HTTP requests and sockets. | Uri, Request, SocketClient |
| ThreadLib | Running work in parallel. | Thread, ParallelTask, ConcurrentDictionary |
| AutomationLib | Running PowerShell from your application. | Powershell, InvocationResult |
| DeviceLib | Device features, such as location, in applications that run on a device. | Sensors, LocationInfo |
| GTFSLib | Reading public-transport feeds in the GTFS format. | Feed, Stop, Route, Trip, StopTime |
| Form Models | Running controller actions of other forms, getting form links, exporting list data. | Execute, GetLink |
| Form Controls | Commands and controls of the form you are on. | Commands, Form Controls |
| Unit Tests | Assertions for unit tests. | Assert |
Where to start¶
- Writing text, numbers or dates: the Standard Library.
- Finding and saving records: the Domain Library and Working with data.
- Knowing who is signed in, or what they may do: AppLib.
- Logging: DebugLib.
- Sending e-mail, serializing, CSV: CommonLib.
- Writing tests: Unit Tests.
Conventions in the reference pages¶
- Static: Yes means you call the method on the class itself, as
AppLib.Security.RegisterUser(...). Static: No means you call it on an object. - Namespace is the full name you type, for example
UnitTests.Assert. - Parameter and return types link to the Standard Library.
Libraries and generated targets
Some libraries only make sense on the server, such as file access. Some depend on the target: DeviceLib is meant for applications that run on a device. Logic that calls .NET libraries stays tied to .NET. See Implementation strategies.