Skip to main content

Bounded Contexts

After the event storming session, the following contexts have been identified:

  • Auth
  • User
  • Monitoring
  • Alarm
  • Notification
  • Location

In the following sections, each context will be described in detail.

Auth

Responsible for managing the authentication and authorization of the users. It also is responsible for managing the permissions of the users.

Ubiquitous Language

TermMeaningSynonyms
RoleRole assigned to a specific user, only two values are admitted: Admin and Guardian-
AdminA user with the maximum level of authority. It can manage permissions of other Guardian users-
GuardianA user that can only view the video stream and visualize the data produced by sensors to which he has accessMonitor
UserEither an admin or a guardian-
PermissionA grant to consult devices in a particular location-

Events

Inbound Events

The Auth bounded context does not receive any event from the other contexts.

Outbound Events

  • LocationMonitoringGranted: event that is sent when a user is granted permission to monitor a location
  • LocationMonitoringDenied: event that is sent when a user is denied permission to monitor a location
  • UserLoggedIn: event that is sent when a user is authenticated

Users

This context is responsible for managing the users of the system, in particular, nothing regarding the authentication process but only the management of the user registry.

Ubiquitous Language

TermMeaningSynonyms
UserGeneric term to refer to anyone registered to the system-
ContactContact on which the specific user will be notified when one anomaly occurs-
Contact TypeContact type of a single contact, two values are admitted: SMS and EMAIL-

Events

Inbound Events

The Users bounded context does not receive any event from the other contexts.

Outbound Events

  • UserAdded: sent when a user is created
  • UserDeleted: sent when a user is updated
  • UserUpdated: sent when a user is updated
  • UserContactsModified: sent when a user contact is modified

Monitoring

It is responsible for managing the devices and the data they produce. This context is responsible for consulting the data produced by the devices, their configurations and everything regarding the WoT interactions.

Ubiquitous Language

TermMeaningSynonyms
CameraDevice that records an environment and transmit the stream to the systemVideo Camera
SensorDevice sensing data from an environment (e.g. temperature)-
DeviceEither a Camera or a Sensor-
Sensor/Camera settingsUser-modifiable configuration of data relative to a specific device-
Transmission intervalThe amount of time between to consecutive measurement transmission in ms-
CapabilityWhat a sensor is able to perceive and transmit-
Video StreamStream of video data produced by a cameraStream, Transmission
MeasurementData produced by a sensorEnvironment data, Sensor data
Numerical measurementA Measurement with a single numerical value and a Measurement Type-
Measurement TypeA physical dimension with its unit of measure (e.g. temperature in Celsius)-

Events

Inbound Events

  • MeasurementReceived: triggered when a new measurement is received
  • VideoStreamReceived: triggered when a new video stream is received

Outbound Events

  • DeviceAdded: sent when a device is added
  • DeviceDeleted: sent when a device is deleted
  • DeviceSettingsModified: sent when some device settings are modified
  • DeviceEnabled: sent when a device is enabled
  • DeviceDisabled: sent when a device is disabled
  • MeasurementStored: sent when a measurement is stored

Alarm

Responsible for managing the alarms in the overall system. It is also responsible for the object recognition feature of the system.

Ubiquitous Language

TermMeaningSynonyms
Security ruleA condition that if not satisfied will trigger an anomalyRule
Intrusion ruleA condition that specify that in a video stream no object of a specific object class can be recognized-
Object classType of object that the system is able to recognizeCategory, Object
Range ruleA condition that will trigger an outlier if the value of a numerical measurement is out of a specific range-
AnomalyIs either an intrusion or an outlier-
DetectionRecognition of an object-
IntrusionDetection of an object in contrast with a particular intrusion rule-
OutlierNumerical measurement with a value in contrast with a particular range rule-

Events

Inbound Events

  • MeasurementReceived: triggered when a device sends a new measurement
  • VideoStreamReceived: triggered when a camera sends the video stream

Outbound Events

  • SecurityRuleAdded: sent when a security rule is added
  • SecurityRuleDeleted: sent when a security rule is deleted
  • SecurityRuleModified: sent when a security rule is modified
  • SecurityRuleEnabled: sent when a security rule is enabled
  • SecurityRuleDisabled: sent when a security rule is disabled
  • SecurityRuleViolation: sent when a security rule is violated
  • AnalyzingStarted: sent when the system starts analyzing a video stream
  • ObjectDetected: sent when an object is detected in a video frame
  • AnomalyDetected: sent when an anomaly is detected
  • AnomalyStored: sent when an anomaly is stored

Location

Responsible for the location management of the system.

Ubiquitous Language

TermMeaningSynonyms
BuildingCoarse grained concept of location referring to a structure (e.g. home, warehouse)-
RoomFine grained concept of location referring to a single space (e.g. living room, entrance, exit)-
LocationGeneric term to refer to a place-

Events

Inbound Events

The Location bounded context does not receive any event from the other contexts.

Outbound Events

  • LocationAdded: sent when a new location is added
  • LocationRemoved: sent when a location is removed

Notification

Responsible for managing the notifications of the system. It is responsible for sending notifications to the users when particular events occur.

Ubiquitous Language

TermMeaningSynonyms
NotificationMessage sent to a user using its recipient'sAlert
Outlier NotificationNotification regarding an Outlier anomaly-
Intrusion NotificationNotification regarding an Intrusion anomaly-
Notification TypeType of notification-
Real-time NotificationNotification sent in real-time to the user-
RecipientThe notification target user's contact

Events

Inbound Events

  • AnomalyDetected: received when an anomaly is detected

Outbound Events

  • NotificationSent: sent when a notification is sent

Model Integrity Patterns

Each bounded context is isolated and has its own vision of domain entities. For this reason, is necessary to define model integrity patterns to ensure that the data is consistent across the contexts.

In the following are listed the DDD patterns used in the system:

  • Shared Kernel: that collects the shared entities between the contexts (Domain Events and some common Entities)
  • Conformist: that allows the contexts to share the same entity but with different representations

Context Map

The following context map shows the relationships between the contexts.

Revue Context Map