0% found this document useful (0 votes)
113 views3 pages

Smart Farm Monitoring System UML Exam

Uploaded by

khoavo091003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views3 pages

Smart Farm Monitoring System UML Exam

Uploaded by

khoavo091003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LAB01: SWD392 -SU25

Duration: 90 Minutes
Instructions:
● You are a software engineer at "GreenTech Solutions". Your current project is to develop
a new Smart Farm Monitoring System that supports agricultural automation.
● Use your knowledge and provide real-world assumptions where needed.
● Draw all diagrams using a UML tool. Submit your diagrams and written answers in a
single document.
● The language level of this exam is designed to be clear and simple.

Questions 1. (3.0 points)


Business Scenario: The system models how smart devices are organized in a farm. A Farm
contains multiple Zones (e.g., greenhouse, rice field). Each Zone consists of various Sensors. A
Sensor is either a TemperatureSensor or a MoistureSensor, each with different properties and
behavior. A Zone cannot exist outside of a Farm, and a Sensor belongs to exactly one Zone.
● Task: Draw a Class Diagram at the entity level (showing only class names, no
attributes).
o Your diagram must show the relationships between Farm, Zone, Sensor,
TemperatureSensor, and MoistureSensor.
o You must correctly show aggregation, composition,
and generalization relationships, including multiplicities.

Questions 2. (2.0 points)


Business Scenario: A farmer wants to view real-time sensor data. The farmer logs into the
MonitoringDashboard (a boundary object). The dashboard sends a request to the
SensorDataController (a control object), which checks the sensor’s status using the
DeviceHealthService (a service object). It then retrieves the latest readings from the
SensorRepository (an entity object) and displays them.
● Task: Choose the best UML diagram (Sequence or Communication) to clearly show
the step-by-step, time-ordered flow of messages for this process. Draw the diagram you
have chosen. You must label each object with its correct application logic stereotype
(«boundary», «control», etc.).
Questions 3. (1.0 points)
Business Scenario: A moisture sensor has a lifecycle. It starts in the Inactive state. When the farmer
turns it on, it moves to the Active state. If the battery is low, it transitions to the LowBattery state.
If disconnected, it moves to the Disconnected state. After recharging or fixing the connection, it
returns to the Active state.
● Task: Draw a Statechart Diagram for a MoistureSensor object.
o Your diagram must show all the states: Inactive, Active, LowBattery,
Disconnected.
o Clearly label the events that trigger the state changes and the actions that occur.

Questions 4. (1.0 point)


Task: Propose a suitable software architecture for the Smart Farm Monitoring System.
● Name the architecture you choose.
● Explain why this architecture is a good choice for this project. Then, list one key
advantage and one key disadvantage.

Questions 5. (1.0 point)


Business Scenario: The system allows farmers to receive notifications based on different criteria:
temperature threshold, soil moisture level, or scheduled timing. Each type of notification is
handled differently. The notification system must allow these algorithms to be swapped or added
without changing the notification interface.
● Task: Identify and name a specific Design Pattern that allows you to define a family of
algorithms, encapsulate each one, and make them interchangeable. Explain why this
pattern is the best solution for this specific problem.

Questions 6. (1.0 point)


Business Scenario: The smart farm system is used by multiple roles:
• Farmers can log in, view sensor data, set thresholds for alerts (e.g., moisture < 30%), and
view reports.
• Technicians can maintain sensors and diagnose problems.
• System Admins manage user accounts and monitor system uptime.
Task: Draw a Use Case Diagram showing all actors and their main use cases.
Use <<include>> and <<extend>> relationships where appropriate.
Organize your diagram for clarity.
Questions 7. (1.0 point)
Business Scenario: The Smart Farm Monitoring System is deployed across several hardware and
software nodes:
• IoT sensors deployed in zones of the farm
• Edge Device (Raspberry Pi or local server) collects sensor data
• Cloud-based Application Server handles business logic and APIs
• Database Server stores all sensor readings and user info
• Users access the system through Mobile App or Web Dashboard.

Task: Draw a Deployment Diagram showing the main nodes, software components deployed on
them, and communication paths between them.

END OF EXAMINATION

Common questions

Powered by AI

The interconnected roles of farmers, technicians, and system admins necessitate a user interface that can accommodate diverse functionalities such as sensor data analysis, maintenance diagnostics, and user account management. This requires the system design to include robust access control measures, user-specific dashboards, and intuitive interaction flows to cater to the distinct needs and responsibilities of each user role, promoting efficiency and security .

Including both software and hardware nodes in the Deployment Diagram is essential as it provides a comprehensive view of the system's architecture, illustrating how different system components such as IoT sensors, Edge Devices, and Cloud-based Servers are physically and logically interconnected. This enhances understanding of data flow and communication paths, crucial for optimizing deployment, improving system reliability, and troubleshooting .

A Sequence Diagram is more appropriate because it effectively represents the specific time-ordered sequence of messages exchanged between objects, such as the MonitoringDashboard, SensorDataController, DeviceHealthService, and SensorRepository. This diagram clearly details the interaction flow, making it suitable for illustrating the step-by-step processing of requests and retrieval of sensor data .

The Smart Farm Monitoring System models device organization by structuring the farm into multiple zones, each containing sensors. There are two types of sensors: TemperatureSensor and MoistureSensor. A Farm contains these zones, and each zone cannot exist outside the Farm, ensuring that the system is efficiently organized. This organizational structure supports efficient management and monitoring of environmental conditions, aiding agricultural automation .

A Use Case Diagram facilitates understanding of user roles such as farmers, technicians, and system admins by visually representing their interactions with the system. It shows main use cases like sensor data viewing, threshold settings, sensor maintenance, and account management. Utilizing <<include>> and <<extend>> relationships helps organize and clarify each actor's possible actions within the system .

A Statechart Diagram is significant for representing the lifecycle of a moisture sensor because it provides a visual depiction of the states and transitions based on events such as activation, low battery, disconnection, and reconnection. This diagram enhances understanding by clarifying the conditions and actions involved in each state, facilitating easier management and maintenance of sensor operations .

The Strategy Pattern benefits the notification system by allowing different algorithms handling temperature, soil moisture, and timing alerts to be encapsulated and swapped without modifying the notification interface. It promotes flexible system extension, enabling new criteria or changes to existing notifications with minimal impact on the overall system design .

The DeviceHealthService plays a critical role in the system architecture by routinely checking the health status of sensors, thereby ensuring reliable operation. Its ability to diagnose and report sensor issues promptly helps maintain system integrity and reduces downtime, crucial for sustaining continuous monitoring and data accuracy in agricultural settings .

The initial inactive state of the moisture sensor indicates that it is not currently monitoring conditions but is ready for activation. This state provides a baseline from which the sensor transitions to active monitoring upon user prompt, ensuring that the sensor's lifecycle is manageable and operational readiness aligns with on-demand usage scenarios .

The layered architectural pattern is advantageous as it separates concerns, allowing different components such as data management and business logic to be developed and maintained independently. This enhances scalability and modularity. However, a disadvantage is potential performance overhead because components must interact through defined layers, which can introduce latency and complexity in the communication between them .

You might also like