↓ Skip to main content
A watercolour of a table with two things on it. On the left lies one thick teal book. On the right stands a small wooden rack with five thin folders side by side, four teal and one orange.

CREWMOBILE and TIMESHEET: Two Small Apps in the Modular MAML Style

Open the main file of the Technician app, and you scroll through more than six thousand lines. Open the main file of Timesheet, and you read forty. Both are apps of the same framework. They differ in where the pages live. We measured the difference across all mobile apps of our system and looked closely at the two smallest apps that keep every page in its own file.

MAS 9.2 series case study

We looked at both apps on our test system, on the MAS 9.2 series. The numbers belong to that release and change with every new version of an app, so read them as a size. Which App for Which Use Case? lists all fifteen apps, and this case study takes two of them apart.

One file, or one file per page
#

An app has a main file, app.xml. A page can stand inside it, or the main file can name another file that holds the page. We counted, for each app, how much of its markup stands in the main file:

AppLines in app.xmlLines of markup in all filesShare of app.xml
Timesheet4036911 %
Crew Manager10673914 %
Material Request19589422 %
Technician6,1339,93262 %
Visual Inspections8561,37462 %
Service Requests1,4191,99071 %
Assets2,4653,18577 %
Locations1,6982,13580 %
Incident Reporter1,0431,18088 %
Inspections1,6601,85290 %
Inventory Counting1,3961,47095 %
Issues and Transfers3,0053,08797 %
Permit to Work2,6222,64799 %
Inventory Receiving8,6248,624100 %
Dashboard216216100 %

The fifteen business apps as shipped with our system of the MAS 9.2 series. The lines are counted with wc -l over the XML files of each source folder.

The table falls into two groups. Twelve apps keep 62 to 100 percent of their markup in the main file. Three apps keep 11 to 22 percent there, and every one of their pages has a file of its own. Technician is at the lower end of the first group and stands between the styles: 10 of its 28 pages have a file of their own, and the rest are in the main file.

What the main file still holds
#

In Timesheet the main file is a table of contents. Its forty lines hold six things:

In app.xml of TimesheetWhat it is
the application elementthe id, the title, the controller of the app
a few statesamong them the ids of three other apps that Timesheet opens
two datasourceslookups that every page may use
a menu with one entrythe entry of the app in the navigation
two page entrieseach one a single line with an id, a path and the name of a file
one small JSON datasourceby its name, for tests

A page entry of this kind is short. Our own Components Explorer is built the same way, and one of its entries reads:

<page id="fs_d_load" file="fs:pages/data-load.xml"/>

The file it names starts with the <page> element and holds everything that belongs to the page: its states, its datasources and its layout. In Timesheet the two page files have 111 and 218 lines.

The JavaScript follows the same order. Both apps sort their controllers into folders by kind: one folder for the page controllers, one for the datasource controllers.

Why the layout matters to you
#

A page can be read alone. A file of a hundred or two hundred lines fits in one sitting. To understand the list page of Timesheet, you open one XML file and two controllers.

A change stays in its file. When two developers work on two pages, they change two files. In an app with one main file, both change the same file and meet in every merge.

An update is easier to compare. When IBM ships a new version, a comparison file by file shows which pages changed. With one large file, every difference lands in the same place.

The second and third point are our reading of the layout. The first one rests on a number: the largest page file of the two apps has 260 lines, where the main file of a large app has several thousand.

Timesheet: the smallest app
#

Two screens of the Timesheet app. First, the list “Today” with one record: a card with the tag “Actual work time”, a start at 08:00 and an end at 10:00, for work order 1221, HVAC overheating. Second, the page “Work period”: the labor Mike Wilson, the craft Electrician, start and end, the type “Actual work time” and a duration of 2 hours, striped bars for the empty fields, and under “Related records” the work order, the asset 11200 and the location BR200, each with an arrow.
The list of today’s work periods, and one work period with its related records

Timesheet shows a person the hours they reported. The selector of its list has three entries: “Today”, “Yesterday” and “Search all records”. A tap on a card opens the work period with its details. The three related records at the bottom lead out of the app: the work order, the asset and the location each have an arrow.

Our demo technician had reported hours only long ago, so the list was empty at first. We added a work period for today, and it appeared.

PartTimesheetCrew Manager
Pages23
Datasources720
Object structures38
Dialogs07
Sliding drawers06
States59
Controller classes58
Methods in these classes2273
XML files314
Lines of markup369739
JavaScript files, without tests and mock data713
Lines in these JavaScript files5472,765

Both apps as shipped with our system of the MAS 9.2 series, where Timesheet is app version 9.2.90 and Crew Manager is app version 9.2.91. Pages, datasources, dialogs, drawers, states and classes are counted by the structure view of our MAF editor, the lines with wc -l.

With five controller classes and 22 methods, Timesheet is an app you can hold in your head. It reads through three object structures, and the one for labor transactions delivers its records.

Crew Manager: the same layout, one size up
#

Three screens of the Crew Manager app. First, the list “My crews” with one record: the crew HVAC1, “HVAC crew, main office”, with the tag ACTIVE and the link “Manage crew”. Second, the page of the crew HVAC1 with the texts “No labor added.” and “No tools added.” Third, a dialog “System message” that says the relationship ITEM does not exist for the business object AMCREW, with the code BMXAA4187E.
The list of crews, the page of one crew, and the message that page raised on our system

Crew Manager is for the person who leads a crew. The list shows the crews of the signed-in user, and “Manage crew” opens one. The page of a crew has a part for its labor and a part for its tools. Seven dialogs and six drawers belong to the app, most of them for adding a person or a tool and for the lookups behind them.

Its layout is the one of Timesheet with more files: three page files, seven files for dialogs and lookups, each dialog in its own file, and three shared files. The largest controller class, for the page of one crew, has 35 methods.

Two things happened on our system that are worth telling.

The list was empty. Our demo data has no crew at all. We made a crew type and a crew, and the list stayed empty. The list “My crews” shows a crew to its supervisor and to the people who are labor of the crew. We named the demo technician as supervisor, and the crew appeared.

The page of the crew raised an error. When we opened the crew, the app showed a system message: the relationship ITEM does not exist for the business object AMCREW. The page stayed in use, with its two empty parts. A datasource of the app asks for a relationship that our Manage does not have. We did not look for the reason on the server side.

The second point is a lesson that returned in several case studies of this series, in a new form. An app is as good as the system behind it. An app can be published and listed on the start screen while one of its pages asks Maximo for something that is missing.

What to take from the two apps
#

  • For your own app, start modular. A main file with one line per page costs nothing on the first day, and it keeps two developers out of each other’s way.
  • Read Timesheet first. It is the smallest complete example of the layout: two pages, seven datasources, 22 methods.
  • Then read Crew Manager for the next steps: dialogs in their own files, lookups, and writes.
  • Test every page on the system it will run on. The list of crews worked, and the page behind it raised an error.

What to read next#

Which App for Which Use Case? places both apps in the family. Understanding app.xml explains the main file, and ICMOBILE - Inventory Count shows a small app of the other style, with almost all its markup in one file.


IBM describes the Crew Manager and Timesheet apps in the documentation of Maximo Mobile. Crews and crew types are maintained in the Crews and Crew Types applications of Maximo Manage.