Skip to content

Domain

lib/domain/ describes what a study is. Nothing in it collects data: it holds the classes you use to write a study protocol, and the data classes a study produces.

It extends the platform-independent carp_core domain model with what a phone needs (Smartphone, SmartphoneStudyProtocol, AppTask, data endpoints, transformers). Both are serialized to JSON, so a protocol can be stored, sent to a server, and deployed to a phone.

The CARP study protocol domain model

A protocol reads left to right: a trigger says when, a task says what to do, and its measures say which data. Task controls join triggers to tasks.

File What is in it
domain/core/smartphone_protocol.dart The protocol you write
domain/core/triggers.dart All triggers
domain/core/tasks.dart, domain/core/app_task.dart Background, function and app tasks
domain/core/data.dart, domain/core/data_types.dart, domain/core/sampling_configurations.dart What is measured, and how
domain/core/device_configurations.dart, domain/core/device_registrations.dart The phone and other devices
domain/core/data_endpoint.dart, domain/core/transformers.dart Where data goes, and how it is reshaped
domain/services/ Interfaces implemented elsewhere: DataManager, NotificationManager, StudyProtocolManager, SamplingPackage