Object –Oriented Analysis and Design of Home Appliance Control System
Phase 1 CS 6359 Sec 581
Abhishek Gupta, Amol Chopra, Syed Waseem Haider {axg034100, axc035100, waseem} @ utdallas.edu
Table of Content
1. Problem Description 2. Use Case Diagram 2.1. Diagram 2.2. Actors 2.3. Use Case Description 2.3.1 Use Case – LoginLogout 2.3.1.1 Sequence Diagram – Login 2.3.1.2 Collaboration Diagram – Login 2.3.2 Use Case – Process Request 2.3.2.1 Sequence Diagram – Process Request 2.3.2.2 Collaboration Diagram – Process Request 2.3.3 Use Case – Control 2.3.3.1 Sequence Diagram – Automatic Device Control 2.3.3.2 Collaboration Diagram – Automatic Device Control 2.3.3.3 Sequence Diagram – Manual Device Control 2.3.3.4 Collaboration Diagram – Manual Device Control 2.3.4 Use Case – Report 2.3.4.1 Sequence Diagram – Report 2.3.4.2 Collaboration Diagram – Report 2.3.5 Use Case – Database Operations 2.3.5.1 Sequence Diagram – Database Operations 2.3.5.2 Collaboration Diagram – Database Operations 2.3.6 Use Case – Appliance Settings 2.3.6.1 Sequence Diagram – Entertainment Settings 2.3.6.2 Collaboration Diagram – Entertainment Settings 2.3.6.3 Sequence Diagram – Microwave Oven Settings 2.3.6.4 Collaboration Diagram – Microwave Oven Settings 2.3.6.5 Sequence Diagram – Security Settings 2.3.6.6 Collaboration Diagram – Security Settings 2.3.6.7 Sequence Diagram – Temperature Settings 2.3.6.8 Collaboration Diagram – Temperature Settings 2.3.7 Use Case – Scheduling 2.3.7.1 Sequence Diagram – Add Schedule 2.3.7.2 Collaboration Diagram – Add Schedule 2.3.7.3 Sequence Diagram – Modify Schedule 2.3.7.4 Collaboration Diagram – Modify Schedule 2.3.7.5 Sequence Diagram – Delete Schedule 2.3.7.6 Collaboration Diagram – Delete Schedule 2.3.8 Use Case – AddRemove Appliances 2.3.8.1 Sequence Diagram – Add Appliance 2.3.8.2 Collaboration Diagram – Add Appliance
2.3.8.3 Sequence Diagram – Remove Appliance 2.3.8.4.Collaboration Diagram – Remove Appliance 2.3.9 Use Case – Display Information 2.3.9.1 Sequence Diagram – Display 2.3.9.2 Collaboration Diagram – Display 3. Class Diagram 4. CRC Card 5. References
1. Problem Description
A home appliance control system (HACS) is a system which provides various services to remote systems such as a mobile phone, desktop and palm-top, to control, monitor and coordinate home appliances such as microwave oven, entertainment system, security system, air conditioning system etc. The HACS system is illustrated below. This document furnishes the Use Case diagrams, Class diagrams, Sequence diagrams and Collaboration diagrams for the Home Appliance Control System using UML.
Users
Appliances
Hacs Controller
Home Appliance Control System
2.1 Use Case Diagram
User
LoginLogout
Appliance settings
Display Information AddRemove appliances
Scheduling
1. Request Demultiplexing. 2. Information processing
Authenticate user.
<>
HACS Controller
Process request
Authenticate
perform all database operations
Report
Report device status to HACS Central Unit.
Control
Control various devices.
Database operations
Appliance
Security System
Temperature Control Microwave Entertainment System
2.2 Actors
Actors are someone or some thing that must interact with the system under development. They are responsible for requesting services from the system. The following are the Actors for HACS. User – They access the system remotely using mobile phone, PDA or the Internet. They are the main entity that operate their home appliances remotely or locally. HACS Controller – It is the unit of the HACS system, which resides at users’ homes and control all appliances. User send its command to HACS controller and it then perform the necessary operations. Appliance – This actor represent the actual devices that user need to operate.
2.3 Use case Description
Login-Sequence diagram
Flow of events: Precondition: User needs a valid user name and password to logon to the HACS. Main Flow: This use case takes in the user name and password and checks for its validity. o After validation, it establishes a session between the remote user and the Appliance controller. o Hacs controller Sends list of appliances according to the user privilege level. Exceptional flow: If the validation fails it sends a message and asks the user to re-enter the user name and password. Post condition: Client is contacted on his last successful remote address, if valid user or session could not be established due to invalid user.
: User 1: login (username, password)
hacsController
database
2: Query
3: Return Information
4: validateuser (username, password)
5: User authenticated
Login- collaboration diagram
4: validateuser (username, passw...
1: login (username, passw... hacsControll er : User 5: User authenticated
2: Query database 3: Return Information
Process Request - Sequence diagram
Flow of events: Precondition: User has been authenticated. A session between remote device such as cell phone or desktop and Hacs controller has been established. Main Flow: This use case begins when user submits request on his user interface for one or more devices. o Hacs controller de-multiplexes user requests. o Hacs controller then dispatches event handler for each event or request. o Each event transfers control to specific use case (Appliance settings, scheduling, display information or Add Remove Appliance) according to user’s input. o Multiplexes all reporting events and sends to the user. Exceptional flow: If session is terminated accidentally, incomplete operations are rolled back. Post condition: Client is asked for more operations if desired.
: User
1: login (username, password)
hacscontrolle r
appliance
database
2: User Authenticated
3: getAppliances()
4: Return List of appliances 5: Requests 6: eventdemultiplexing(requests)
7: eventhandlerdispatching(event)
8: event1
9: Validate event 10: event2
11: event3 recvReport(appliance, settings)
12: return event1 information
13: return event2 information 14: event2 update database
15: eventmultiplexing(events)
16: Confirmation
Process Request- Collaboration diagram
6: eventdemultiplexing(requests) 7: eventhandlerdispatching(event) 15: eventmultiplexing(events) 1: login (username, passw... 5: Requests hacscontrol ler : User 2: User Authentic... 16: Confirmation
12: return event1 information 4: Return List of appliances 3: getAppliances() 8: event1 14: event2 update database 9: Validate event
11: event3 recvReport(appliance, settings) 13: return event2 information 10: event2
database
applianc e
Automatic Device Control- Sequence diagram
Flow of events: Precondition: A communication link between devices and Hacs Controller exists. Main Flow: This use case begins when Hacs Controller sends signal to Appliances in result of either a scheduled operation in Hacs controller is triggered or an event reported by appliances. o Appliances provide the requested service by calling the appliance operation. Exceptional flow: If session between Hacs Controller and appliances is terminated accidentally, incomplete operations are rolled back. Post condition: User is notified.
: HACS Controller
1: requestStatus(appliance)
appliances
database
microwave
securitySystem
temperatureControl
entertainmentSyste m
2: recvReport(Appliance, Status) 3: getSchedules()
4: Return Schedules
5: Process data
6: controlSignal() 7: operate
8: operate
9: operate
10: operate
Automatic Device Control- Collaboration diagram
database 5: Process data 3: getSchedules() 4: Return Schedules
: HACS Controller
1: requestStatus(applia... 6: controlSignal() 2: recvReport(Appliance, Status) appliances
10: operate 7: operate 8: operate 9: operate
microwave
securitySyst em
temperatureC ontrol
entertainment System
Manual Device Control- Sequence diagram
Flow of events: Precondition: User has been authenticated. A session between remote device such as cell phone or desktop and Hacs controller has been established. User has submitted his/her request. A communication link between devices and Hacs Controller exists. Main Flow: This use case begins when Hacs Controller sends signal for a request, submitted by user, to Appliances. o Appliances provide the requested service by calling the appliance operation. Exceptional flow: If session is terminated accidentally, incomplete operation is rolled back. Post condition: User is notified.
: User
hacsController
appliances
microwave
securitySystem
entertainmentSyste m
temperatureControl
1: login (username, password)
2: User Authenticated
3: Send User Request
4: Process User Request
5: Send control Signal 6: operate
7: operate
8: operate
9: operate
Manual Device Control- Collaboration diagram
4: Process User Req... 1: login (username, passw... 3: Send User Request hacsControll er : User 2: User Authenticated
5: Send control Signal
appliances
6: operate
9: operate 8: operate 7: operate
microwave
securitySystem
entertainment System
temperature Control
Report – Sequence diagram
Flow of events: Precondition: A communication link between appliances and Hacs Controller exists. Main Flow: This use case begins when an appliance sends a trigger to appliances object. o Appliances object checks the status of originating appliance. o Sends the status information to the Hacs Controller. Exceptional flow: If the requested device is not a valid appliance, appliances sends back an error report. Post condition: User is notified.
: Appliance
appliances
hacsControll er
1: Trigger notification for an event
2: requestStatus(appliance)
3: recvReport(appliance,settings)
Report – Collaboration diagram
2: requestStatus(appliance)
1: Trigger notification for an event applianc es : Appliance 3: recvReport(appliance,settings)
hacsContr oller
Database operation- Sequence diagram
Flow of events: Precondition: Connectivity between Hacs Controller and database is established. Main Flow: This use case begins when Hacs Controller sends request for an operation to database. o Database validates the operation. o Database carries out the operation. Exceptional flow: If the operation requested is invalid, database reports back an error. Post condition: Return the result.
: HACS Controller
database
1: databaseOperation (operation) 2: validateOperation (operation)
3: performOperation (operation)
4: Return Result
Database operation- Collaboration diagram
2: validateOperation (operation) 3: performOperation (operation)
1: databaseOperation (operation)
database
4: Return Result : HACS Controller
Entertainment system setting - Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: After validation. o User selects entertainment system and requests desired settings from a menu displayed on user interface to the Hacs controller. o Hacs controller handles the request with as explained in process request. o Appliances forwards the request to the entertainment system as explained in control use case. o Entertainment system receives the request and carries out the desired operation. Exceptional flow: If the communication between entertainment system and Hacs controller fails, the operation is rolled back. Post condition: User is acknowledged and settings are stored in the database.
: User 1: login(username,password) 2: user authenticated
hacsController
database
appliance
entertainment System
3: Query for Appliances
4: Return the list of appliances
5: List of appliances
6: Change entertaintment system settings 7: updateSettings(appliance, settings) 8: configure(settings) 9: Updated 10: Updated
11: write settings
12: Confirmation
Entertainment system setting- Collaboration diagram
1: login(username,password) 6: Change entertaintment system sett... hacsController 7: updateSettings(appliance, settings) appliance 10: Updated
: User
2: user authenticated 5: List of appliances 12: Confirmation
4: Return the list of appliances 3: Query for Appliances 11: write settings
9: Updated 8: configure(settings)
databas e
entertainment System
Microwave setting- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: After validation. o User selects Microwave and requests desired settings from a menu displayed on user interface to the Hacs controller. o Hacs controller handles the request with as explained in process request. o Appliances forwards the request to the entertainment system as explained in control use case. o Microwave receives the request and carries out the desired operation. Exceptional flow: If the communication between Microwave and Hacs controller fails, the operation is rolled back. Post condition: User is acknowledged and settings are stored in the database.
: User 1: login(username,password) 2: user Authenticated
hacsController
database
appliance
microwave
3: Query for Appliances 4: Return the list of appliances 5: List of appliances
6: performOperation(microWave,settings) 7: updateSettings(appliance, settings) 8: configure(settings) 9: updated 10: updated
11: write settings
12: confirmation
Microwave setting- Collaboration diagram
1: login(username,password) 6: performOperation(microWave,settings)
hacsController
7: updateSettings(appliance, settings) appliance 10: updated
: User
2: user Authenticated 5: List of appliances 12: confirmation
4: Return the list of applia... 3: Query for Appliances 11: write settings
9: updated 8: configure(settings)
microwave database
Security system setting- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: After validation. o User selects Security system and requests desired settings from a menu displayed on user interface to the Hacs controller. o Hacs controller handles the request with as explained in process request. o Appliances forwards the request to the entertainment system as explained in control use case. o Security system receives the request and carries out the desired operation. Exceptional flow: If the communication between Security system and Hacs controller fails, the operation is rolled back. Post condition: User is acknowledged and settings are stored in the database.
: User 1: login(username,password) 2: User Authenticated
hacsController
database
appliance
securitySystem
3: Query for Appliances 4: Return the list of appliances 5: List of appliances
6: performOperation(security,settings) 7: updateSettings(appliance, settings) 8: configure(settings)
9: Updated 10: Updated 11: Write settings
12: Confirmation
Security system setting- Collaboration diagram
1: login(username,password) 6: performOperation(security,settings)
hacsController
7: updateSettings(appliance, settings)
appliance
: User
2: User Authenticated 5: List of appliances 12: Confirmation
10: Updated
4: Return the list of appliances 3: Query for Appliances 11: Write settings
9: Updated 8: configure(settings)
database security System
Temperature Control setting- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: After validation. o User selects Temperature control and requests desired settings from a menu displayed on user interface to the Hacs controller. o Hacs controller handles the request with as explained in process request. o Appliances forwards the request to the entertainment system as explained in control use case. o Temperature Control receives the request and carries out the desired operation. Exceptional flow: If the communication between Temperature Control and Hacs controller fails, the operation is rolled back. Post condition: User is acknowledged and settings are stored in the database.
: User 1: login(username,password) 2: User Authenticated
hacsController
database
appliance
temperature Control
3: Query for Appliances 4: Return the list of appliances
5: List of appliances
6: performOperation(airconditioner,settings) 7: updateSettings(appliance, settings)
8: configure(settings)
9: Updated 10: Updated 11: Write settings
12: Confirmation
Temperature Control setting- Collaboration diagram
1: login(username,password) 6: performOperation(airconditioner,settings)
hacsController
7: updateSettings(appliance, settings) 10: Updated
appliance
: User
2: User Authenticated 5: List of appliances 12: Confirmation
4: Return the list of applia... 3: Query for Applia... 11: Write sett...
9: Updated 8: configure(settings)
database
temperature Control
Add Schedule- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: This use case starts with the display information use case for a selected appliance. o User creates a schedule for an appliance and request Hacs Controller. o Hacs controller handles the request as explained in process request. o Hacs Controller saves the schedule on the database as explained in database operations use case. Exceptional flow: If the schedule is not valid user is asked to provide a valid schedule. Post condition: User is notified.
: User
1: requestApplianceStatus()
hacsController
database
2: Return AppliancesStatus
3: createSchedule()
4: addSchedule()
5: saveSchedule()
6: validate
7: Schedule Created
8: Schedule Created
Add Schedule- Collaboration diagram
3: createSchedu... 6: validate
1: requestApplianceStat... 4: addSchedu... hacsControll er : User 2: Return AppliancesStatus 8: Schedule Created
5: saveSchedule() database 7: Schedule Created
Modify Schedule- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: This use case starts by requesting the schedule for a selected appliance. o Hacs controller handles the request as explained in process request and returns the schedule. o User edits the schedule and sends to the Hacs Controller. o Hacs Controller saves the schedule on the database as explained in database operations use case. Exceptional flow: If the schedule is not valid user is asked to provide a valid schedule. Post condition: User is notified.
: User
1: requestSchedules()
hacsController
database
2: getSchedules (user)
3: Return Schedules
4: Return Schedules 5: requestScheduleDetails() 6: getScheduleDetails()
7: Return Schedule Details 8: editSchedule()
9: saveSchedule() 10: validateSchedule()
11: saveSchedule()
12: Schedule Saved
13: Schedule Saved
Modify Schedule- Collaboration diagram
8: editSchedu... 10: validateSchedu... 2: getSchedules (user) 6: getScheduleDetai... 11: saveSchedule() databas e
1: requestSchedul... 5: requestScheduleDetai... 9: saveSchedu...
: User
hacsControll er 4: Return Schedules 7: Return Schedule Det... 3: Return Schedules 13: Schedule Saved 12: Schedule Saved
Delete Schedule- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: This use case starts by requesting the schedule for a selected appliance. o Hacs controller handles the request as explained in process request and returns the schedule. o User deletes the schedule and commits to the Hacs Controller. o Hacs Controller validates the delete schedule request then request the desired operation to the database as explained in database operations use case. Exceptional flow: If the schedule is not valid user is asked to provide a valid schedule. Post condition: User is notified.
: User
1: List Schedules
hacsController
database
2: requestSchedule(user)
3: Return Schedules
4: Return Schedules 5: Delete Schedule
6: validate schedule
7: Delete Schedule
8: Schedule Deleted
9: Schedule Deleted
Delete Schedule- Collaboration diagram
6: validate schedule 1: List Schedules 5: Delete Schedule hacsControll er 4: Return Schedules : User 9: Schedule Deleted 3: Return Schedules 8: Schedule Deleted 2: requestSchedule(u... 7: Delete Schedule databas e
Add Appliance- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. Main Flow: This use case starts when user sends add a new appliance request to Hacs Controller. o Hacs controller handles the request as explained in process request use case. o Hacs Controller adds the entry for new appliance on the database as explained in database operations use case. Exceptional flow: If the appliance settings are not valid user is asked to provide valid settings. Post condition: User is notified.
hacsController : User 1: login(username,password)
database
2: user authenticated
3: add(appliance, settings)
4: addentry(appliance, settings)
5: validate
6: return information
7: Confirmation
Add Appliance- Collaboration diagram
5: validate 1: login(username,passw... 3: add(appliance, settings) hacsContr oller : User 2: user authenticated 7: Confirmation 6: return information
4: addentry(appliance, settings) databas e
Remove Appliance- Sequence diagram
Flow of events: Precondition: User initiates a session with a remote device. Once validated successfully by Hacs Controller, a list of appliances is sent according to the user privilege level. A list of appliance is displayed to the user. Main Flow: This use case starts when user sends a remove appliance request to Hacs Controller for a selected appliance. o Hacs controller handles the request as explained in process request use case. o Hacs Controller validates the request and sends to the database as explained in database operations use case. Exceptional flow: If the appliance is being used by another user, the requesting user is asked to wait or try another time. Post condition: User is notified.
hacscontroller : User 1: login (username, password)
database
2: user authenticated
3: remove(appliance)
4: delentry(appliance)
5: Validate appliance
6: return information
7: Confirmation
Remove Appliance- Collaboration diagram
5: Validate appliance 1: login (username, passw... 3: remove(appliance)
hacscontroller
4: delentry(appliance) databas e 6: return information
: User
2: user authenticated 7: Confirmation
Display Information- Sequence diagram
Flow of events: Precondition: User has been authenticated. A session between remote device such as cell phone or desktop and Hacs controller has been established. A list of available devices has been sent to the user. Main Flow: This use case begins when user submits request on his user interface for the status of one or more devices to Hacs Controller. o Hacs Controller handles the request as explained in process request use case. o Hacs Controller requests appliances to get the status of the desired appliances. o Appliances reports back the status using report use case. o Multiplexes all reporting events and sends to the user. Exceptional flow: If session is terminated accidentally, incomplete operations are rolled back. Post condition: Results are sent back to user.
: User
hacsControll er
database
appliances
1: login(username,password)
2: user authenticated 3: Query for Appliances
4: Return List Of Appliances
5: requestApplianceStatus(appliance) 6: getApplianceSettings(appliance)
7: Return Settings of the Appliance
Display Information- Collaboration diagram
database
3: Query for Appliances 4: Return List Of Appliances 1: login(username,password) 5: requestApplianceStatus(appliance)
hacsController
2: user authenticated : User
6: getApplianceSettings(appliance) 7: Return Settings of the Appliance
appliances
3. Class Diagram
4. CRC CARDS
Name : Users Super Class : None Sub Class : None Responsibilities : Collaborators : Maintains username and 1. HacsController password, collects machine IP and the privileges for a particular session.
Name : Schedule Super Class : None Sub Class : None
Responsibilities : Collaborators : Maintains the schedule for a 1. HacsController. particular session.
Name : HacsController Super Class : None Sub Class : None
Responsibilities : Collaborators : Central Entity that validates the 1. User. users and enables him use the 2. Database. privileges set for him. 3. Appliances. Inputs the user requests and demultiplexes the requests to identify the desired functions. Interacts with the appliances to get and set various settings as desired by the user. Stores and retrieves information from the database.
Name : Database Super Class : None Sub Class : None
Responsibilities : Collaborators : Enables read from and writing to 1. HacsController the database as per user request.
Name : Appliances Super Class : None Sub Class : TemperstureControl : MicrowaveSetting : EntertainmentSetting : SecuritySetting
Responsibilities : Collaborators : Receive the updates information 1. HacsController from the appliance. Request the status from the appliance for the user. Controls the settings for various appliances.
Name : TemperatureControl Super Class : Appliances Sub Class : None
Responsibilities : Set the temperature devices.
of
the
Collaborators : 1. Appliances
Name : MicrowaveSetting Super Class : Appliances Sub Class : None
Responsibilities : Collaborators : Sets the modes for cooking. 1. Appliances Sets the time intervals for heating the food.
Name : EntertainmentSetting Super Class : Appliances Sub Class : None
Responsibilities : Collaborators : Sets the channels for the 1. Appliances entertainment systems when switched. Sets the volume and other settings for the systems.
Name : SecuritySetting Super Class : Appliances Sub Class : None
Responsibilities : Collaborators : Sets the alarm times. 1. Appliances Controls the various doors and windows where security needs to be provided.
5. References
1. Grady Booch, james Rumbaugh, Ivar Jacobson, “The Unified Modeling Language User Guide”. 2. Professor Lawrence Chung, Lecture Notes