2 Expose + consume • Keep the domain behavior that already works. • Add communication responsibilities without duplicating the core logic. • Integrate independently owned stories through an agreed contract. 3 Later Deploy + operate
Temperature value + unit • One source of domain logic. • REST and MQTT are ways to reach or move that functionality/data. • Adding an interface should not require rewriting the feature. 4 MQTT Adapter
GET /temperature → retrieve the resource. • POST /temperature → send a new representation. • Java 17 provides HttpServer and HttpClient; Jackson handles JSON. 6 method call TemperatureService CORE
TemperatureService CORE MQTT Provider PUBLISH MQTT Broker • Topic: csc5100/example/temperature • Provider serializes Temperature as JSON and publishes it. • Consumer subscribes and reconstructs the Temperature object. • Eclipse Paho is the MQTT client library; the broker is external infrastructure. 9 MQTT Consumer SUBSCRIBE
provider agreed contract CONSUME Feature REST consumer + MQTT consumer • Each student owns one GitHub Feature. • Both students must coordinate before coding. • Both REST and MQTT must work between the paired implementations. • The GitHub Feature contains the feature-specific architecture and Acceptance Criteria. 11
partner's Feature. • Review the existing classes identified in GitHub. • Agree on the REST endpoint, method, JSON, and status behavior. • Agree on MQTT topic(s), payload, publisher/subscriber behavior. • Create Tasks as sub-issues of your Feature. • Then implement. Do not build two sides independently and hope they integrate later. 13
responsibility • Refactor when necessary. • Add classes for genuinely new responsibilities. • Do not duplicate core logic in REST and MQTT implementations. • Think OCP and SRP. 14
Feature satisfies its Acceptance Criteria. • Tasks exist as sub-issues and reflect the work performed. • REST communication works with your partner. • MQTT communication works with your partner. • Existing/domain functionality is reused rather than duplicated. • Tests, JavaDoc, documentation, and Astah UML are updated. 15 f • A Pull Request is submitted and instructor feedback is addressed.
2026 Copyright. These slides may be used only as study material for CSC 5100 within the California State University system. They may not be distributed or used for any other purpose.