How to Design UML Diagrams

How to Design UML Diagrams

Example case, sequence, and deployment Unified Modeling Language (UML) diagrams with explanations

Diagrams for an in-home smart thermostat system

UML Case Diagram

For the smart thermostat system, a UML case diagram has been created. The case diagram’s purpose is to showcase the actors, use cases, and their relationships within the system. (UML Models: Design & Examples, 2018) The diagram was created following UML standards, with ovals representing the use cases, the stick figure representing the homeowner (actor), and a square representing the smart thermostat itself. As seen in the above diagram, arrows and their directions represent the relationships between different elements of the diagram. A dashed line was used for the temperature lock use case, as it is an optional feature that the homeowner may or may not use.

The diagram first starts with the homeowner, represented as a stick figure. In the case of the Smart Thermostat, the homeowner would be the client that is using the smart thermostat in their house. The homeowner has two direct interactions with the smart thermostat, the temperature lock and the manual adjusting of temperature. The temperature lock is designed so that a homeowner can lock the temperature to a specific temperature, to avoid other people from tampering with it. The manual adjusting is so that a homeowner would still have the ability to manage their own temperature if they chose to do so.

The smart thermostat itself will have the capabilities to detect the current temperature, and automatically update the temperature itself. Detection and automatic updates are reliant on each other, as the thermostat is unable to set the temperature if it cannot detect what the current temperature is. The smart thermostat also has the capability to interact with the weather forecast, allowing for a more precise update to temperature dependent on what the weather currently is, and what the weather may be in the future.

UML Sequence Diagram

The UML sequence diagram was designed to showcase the interaction between objects in the smart thermostat, as well as their order of execution (UML Models: Design & Examples, 2018). Similar to the case diagram, the sequence diagram was designed in accordance with the unified modeling language standards. The diagram has three objects depicted in squares, the smart thermostat, the temperature sensor, and the automatically adjusting temperature. The three objects each have a dashed line beneath them to increase readability. The dashed lines are then connected by solid arrows with the direction representing the flow of information between the objects.

The smart thermostat device itself requests the current temperature, and also is responsible for determining the temperature adjustment that is needed. The temperature sensor is able to detect the current temperature, and relay that information to the automatic adjustment of the temperature. The automatic adjustment is able to adjust the temperature accordingly, based on the information that it is receiving from the temperature sensor. By processing information in this way, it makes it simple for the smart thermostat system to accurately and efficiently adjust the temperature as it is needed.

UML Deployment Diagram

Following the same unified modeling language standards in the other two diagrams, the UML deployment diagram was created to showcase the physical components of the smart thermostat and how they interact with each other (Practical Application for Software Engineering: UML Deployment Diagram, 2018). The smart thermostat device is represented as a box, and has wired connections to the temperature sensor as well as the house's current HVAC system. It also has an ethernet connection from the wifi router, and a wireless connection to the integrated software that exists within itself.

The wifi router uses an ethernet cable to establish its connection with the smart thermostat. This method is used because it provides the fastest and most reliable internet, allowing the smart thermostat to access the weather forecast with ease. The HVAC system already exists within the homeowners house, it is just a matter of connecting to this system and integrating it with the smart thermostat. The temperature sensor is also connected to the smart thermostat through a wired connection, and provides an accurate and real time temperature that the smart thermostat uses to make updates to the current temperature in the house. The integrated software was included in this diagram to showcase its importance to the smart thermostat system, without the software the system would not be able to run. The UML deployment diagram is an effective way to showcase the physical components of the smart thermostat system, and gives the reader clarity as to the relationships between the different objects.

References

UML Models: Design & Examples. (2018, August 22). Retrieved from https://study.com/academy/lesson/uml-models-design-examples.html.

Practical Application for Software Engineering: UML Deployment Diagram. (2018, June 18). Retrieved from https://study.com/academy/lesson/practical-application-for-software-engineering-uml-deployment-diagram.html.

Did you find this article valuable?

Support Jake Watembach by becoming a sponsor. Any amount is appreciated!