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.
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.
Where in the repo
Section titled “Where in the repo”| 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 |
Study protocolProtocol, deployment and study
TriggersWhen to collect, and how to add your own
Tasks and app tasksWhat to do when triggered
Measures and dataMeasure types, sampling configurations, measurements
DevicesThe phone, BLE devices and online services
Data endpoints and privacyWhere data goes and how it is transformed
JSON serializationPolymorphic JSON for your own classes