MADS V5 platform concepts

The platform

MADS V5 ships as Maven artifacts under the madsv5 group. The main ones are:

Artifact What it provides
platform Root parent POM: pins the versions of every dependency
mads-module Parent POM of application modules
mads-service Parent POM of web service modules
mads-comlib Common library: entity model, user interface, action framework
mads-w3lib Web components: servlets, JSON, file uploads, Excel
mads-jpalib JPA persistence with EclipseLink and database connectivity
mads-reporting Reports with Pentaho Reporting
mads-jtest JUnit test utilities for MADS modules

Modules

A module is a Maven project that bundles a complete feature: its data model, logic, screens and texts. Applications are made of several modules, and the platform includes reusable ones such as security (users and permissions) and parameters (configuration parameters).

Each module has a .mads file at its root with its name, version, descriptor and default runtime, and its resources under src/main/res:

Folder Contents
xml/ Metadata: descriptor, domains, database schema, texts, parameters and access keys
txt/ Translated texts, one file per language (for example _es, _en, _ca)
run/ Runtimes and launchers to run the module

The XML files are validated against the schemas published at mads.sivicom.cat/xsd, so the editor flags structural errors as you type.

Metadata

  • Descriptor: the module's identity, base package and its schema and text files.
  • Domains: reusable business data types (lengths, formats, lists of valid values) shared by every column that uses them.
  • Database schema: the module's tables, columns, keys and views.
  • Texts: user interface literals, with their translation per language.
  • Parameters: the module's configuration values, with their dictionary.
  • Access keys: permissions that the security module grants to users and roles.

The generated model

mads generate module reads the metadata and generates the module's Java code. For every entity you get:

  • The JPA entity (for example Factura).
  • The Peer class (FacturaPeer), with data access.
  • The Filter class (FacturaFilter), with a FacturaField enum holding one constant per column.

That enum is the key to MADS quality: module code refers to columns as FacturaField.estado and never as the string "FAC_ESTADO". If a column changes or disappears, the code using it stops compiling and the error is fixed before it reaches production.

The same generation produces the texts in every language, the parameter dictionary and, with mads generate dart, the entity model for Flutter apps.

Runtimes and apps

  • A runtime is a run configuration of the module (connection, environment, options). A module can have several —development, test, production— and a default one.
  • An app is an application created for a module, with its own versioning, which can be published and distributed.
  • WAPP is Sivicom's service where modules and apps are published (mads pub module, mads pub app) and from which users download and run apps (mads run app).

Target platforms

Target How
Desktop Swing user interface with the modern MADS look and feel
Web services Service modules based on mads-service and mads-w3lib
Mobile and cross-platform The mads_flutter package and the generated Dart model