Connected Product and Service Design · Study deck

IoT Design Patterns: Responsibility Boundaries

A building light can fail after one part changes because no one knows which part owns state.

UX Uma is your guide for this deck.

design-patternscomponent-designgateway-pattern
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • define component boundaries that hide implementation details but expose the evidence a system needs
  • explain when Gateway, Digital Twin, Command, and Observer patterns fit an IoT design problem
  • combine patterns without hiding ownership, stale state, duplicate commands, or event-ordering problems
  • use model-driven design when repeated deployments need consistent generated artifacts
Pattern and component review path from observed evidence to the change condition.
Pattern and component review path from observed evidence to the change condition.
iotclass.org

Major section

Start Simple

The team needs to know which part owns the command, which part stores state, and which part reports the result.

  • A pattern is useful when it makes that duty clear.
  • A gateway is a device or service that joins one system boundary to another.
  • A design pattern is a reusable way to assign a job.
  • It sits at a boundary.

Key terms

gateway
gateway is a device or service that joins one system boundary to another.
Rights
Rights are checked first.
Safe preconditions
Safe preconditions are checked.
iotclass.org

Major section

Start Simple (continued)

A gateway may translate and buffer.

  • A digital twin may hold a known view of device state.
  • A command record may track an asked-for action.
  • An observer may pass an event to listeners.
  • Each choice needs a clear owner, input, output, fault state, and test.
iotclass.org

Major section

Overview: Patterns Assign Responsibility

IoT patterns are useful when they make a responsibility testable.

  • A gateway is not just a box between devices and the cloud.
  • A digital twin is not just a database row.
  • A command is not just a function call.
  • An observer stream is not just a list of subscribers.

Why it matters

It may need a digital twin because several services need the same room state, freshness, and confidence rule.

Pattern review starts by separating component responsibilities, then checks whether interfaces, data flow, automation, and user-facing outputs have explicit owners.
Pattern review starts by separating component responsibilities, then checks whether interfaces, data flow, automation, and user-facing outputs have explicit owners.
iotclass.org

Major section

Overview: Patterns Assign Responsibility (continued)

The room twin then represents occupancy and freshness rather than owning the sensor itself.

  • Each pattern should clarify who owns state, what crosses the boundary, what fails visibly, and what support can inspect.
  • It may need commands because physical actions must be accepted, rejected, retried, or audited.
  • The pattern record should also show rejected alternatives.
iotclass.org

Major section

Overview: Patterns Assign Responsibility (continued)

It may need observers because dashboards, logs, alerts, and support views should receive events without becoming hidden controllers.

  • A light sensor sends a reading through the gateway, where the MQTT contract names the topic, schema, units, timestamp source, and retry rule.
  • A command follows a separate route back toward the device, where local fallback and the result must be visible.
  • That distinction is needed when a repeated command or stale reading reaches the dashboard.
iotclass.org

Major section

Overview: Patterns Assign Responsibility (continued)

For a building-control system, a gateway may translate Modbus, BACnet, Zigbee, or BLE data into MQTT topics.

  • A room twin may represent occupancy, freshness, confidence, and actuator relationships.
  • A command handler may validate authorization and preconditions before changing ventilation.
  • Observer events may feed dashboards, logs, alerts, and support tools without turning every subscriber into a controller.
iotclass.org

Major section

Practitioner: Make Contracts Concrete

Pattern reviews should leave behind contracts that engineers and support teams can test.

  • For a gateway, that means the device-side protocol, normalized field names, units, timestamp source, queue limit, retry policy, and local fallback rule.
  • For a twin, it means desired state, reported state, last update time, confidence, relationship fields, schema version, and authority for conflict resolution.
  • The pattern choice should explain why the selected option fits the user promise and operating burden.
iotclass.org

Major section

Boundary Drift in Models

A gateway and cloud service may both rewrite device state.

  • A command queue and direct API may both actuate the same relay.
  • A digital twin may store desired state while the dashboard treats it as measured state.
  • An observer may publish an event that one subscriber treats as a fact and another treats as a command.

Why it matters

Model-driven design can reduce this drift only when the model is clear.

iotclass.org

Major section

Boundary Drift in Models (continued)

The technical cause is usually a missing authority rule.

  • Telemetry, state, command intent, command result, alert, and support diagnosis are different facts even when they share a device ID.
  • A robust pattern model separates them before code is written.
  • Each one needs a timestamp, version, and failure label.
  • Under the hood, the safest pattern combinations are traceable.
iotclass.org

Major section

Boundary Drift in Models (continued)

A source model can generate MQTT topics, JSON Schema payloads, OpenAPI documentation, dashboard labels, test fixtures, or support checklists.

  • A sensor event can be followed through topic, schema, gateway log, twin update, observer event, dashboard render, and support record.
  • A command can be followed from issuer, permission check, precondition, queue, actuator acknowledgement, retry decision, and user feedback.
  • Version contracts: version schemas, events, commands, and generated artifacts so old devices and new services can coexist safely.
iotclass.org

Deck summary

Key takeaways

The team needs to know which part owns the command, which part stores state, and which part reports the result.

  • A gateway may translate and buffer.
  • IoT patterns are useful when they make a responsibility testable.
  • The room twin then represents occupancy and freshness rather than owning the sensor itself.
  • It may need observers because dashboards, logs, alerts, and support views should receive events without becoming hidden controllers.
iotclass.org

Retrieval practice

Recall check 1 of 4

UX Uma says: answer from memory, then check your reasoning.

Q1A team chooses a gateway, digital twin, command handler, and observer stream for shared building controls. Which pattern record makes the boundary decision reviewable?

AA polished screen mockup, familiar mobile patterns, and a note that building controls use standard smart-home labels.
BA feature list for automation, alerts, dashboards, setup, and support links without boundary owners or failure evidence.
CA happy-path demo with devices online, permissions pre-granted, and no stale-state, rejection, or gateway-fallback test.
DA bounded pattern record with boundaries, state owner, command rules, fallback, evidence, and change trigger.
Show answer

Answer: D A reviewable pattern decision ties the product promise, boundary, selected pattern, rejected alternative, interface contract, state or command behavior, failure mode, evidence, owner, open issue, and change condition together before implementation.

iotclass.org

Retrieval practice

Recall check 2 of 4

UX Uma says: answer from memory, then check your reasoning.

Q2A gateway service can be replaced, but the new service may drop duplicate commands. What must its component boundary specify?

ASpecify language only and leave duplicate handling to replacement service.
BDefine inputs, outputs, state owner, duplicates, errors and tests.
CSpecify only team name, omitting command state and error ownership.
DSpecify one diagram arrow but no duplicate-command contract or test.
Show answer

Answer: B Inputs, outputs, state owner, duplicate-command behavior, errors, and test evidence.

iotclass.org

Retrieval practice

Recall check 3 of 4

UX Uma says: answer from memory, then check your reasoning.

Q3Several sites use generated device topics and dashboard labels. A label is wrong in every site. What should the team fix first?

APatch each dashboard while leaving the shared source error intact.
BChange a packet without updating the label-generation model.
CFix shared source model, regenerate labels, and trace its version.
DHide the wrong label instead of correcting its shared source.
Show answer

Answer: C Correct the reviewed source model, regenerate the artifacts, and trace the model version.

iotclass.org

Retrieval practice

Recall check 4 of 4

UX Uma says: answer from memory, then check your reasoning.

Q4A small monitor needs only its last known room state. No team needs simulations or linked assets. Which design is easiest to justify?

AA retained state topic with an explicit freshness rule.
BA full digital twin for each simple last-known room value.
CSeveral stores each claiming authority for the same room state.
DA dashboard value with no source timestamp or freshness test.
Show answer

Answer: A A simple state path can meet the reviewed need without an extra twin service.

iotclass.org

Print reference

Answers

Answer key.

  1. D · A reviewable pattern decision ties the product promise, boundary, selected pattern, rejected alternative, interface contract, state or command behavior, failure mode, evidence, owner, open issue, and change condition together before implementation.
  2. B · Inputs, outputs, state owner, duplicate-command behavior, errors, and test evidence.
  3. C · Correct the reviewed source model, regenerate the artifacts, and trace the model version.
  4. A · A simple state path can meet the reviewed need without an extra twin service.
iotclass.org