The following sections detail the analysis and design of the EZ Coffee Brewer system. Importantly, six analysis models and three design models were selected in the exploration of the given problem statement. The analysis models covered are the use case diagram, use case scenarios, class model, context diagram, data flow diagram (level 1), and statechart diagram. The design models covered are the class, responsibilities, and collaboration (CRC) cards; collaboration diagram; and subsystem diagram.
For analysis, the use case model was chosen to understand the primary usages of the system by the user. This allowed the team to focus on only the most important functionality throughout the project. The use case scenarios were used to fully understand the process of setting up the machine and brewing the coffee from start to finish to ensure consistency across different models for the remainder of the analysis and design. Similarly, the class diagram was used to understand the various components of the system and how they exist in relation to one another. Identifying interdependencies and interactions here was vital in beginning to draft collaborations in the design phase of the project. On the other hand, the context, data flow, and statechart diagrams were drafted to understand the technical functionality of the coffee machine. These were based on the use case scenarios previously drafted.
For the design phase of the project, a primary interest was placed on the CRC cards and corresponding collaboration and subsystem diagrams. By taking ample time to iterate and fully draft these models, a thorough understanding of the implementation classes and their collaborations was achieved.
Importantly, all models and methods were created within a three-week time period. The analysis models were first drafted, followed by the design models. However, after the first drafts were completed, the analysis and design models were iteratively fleshed out to ensure consistency throughout the project.
Several assumptions were made throughout the process. These assumptions are listed below.
Assumptions:
1) The coffee machine may enter a pairing state by holding down the On/Off Button. This assumption is used in the development of the CRC cards.
2) The user does not need to obtain the phone application to accomplish brewing and setting up the machine, though the phone application may be used to initiate the process if desired.
3) The warmer plate may be turned on by quickly tapping the power button on the coffee machine if the user does not wish to enable the warmer plate through the phone application.
4) The coffee machine does not allow the user to brew coffee without any water available for brewing. At least one cup of water must be poured into the coffee machine to allow brewing to occur.
Use Case Model
Four actors are identified as pertaining to the use cases of this system: User, Cellphone Application, Coffee Machine Interface, and Warmer Plate. The user is the primary actor of the system and utilizes the system for the purpose of brewing coffee. The other actors assist the user in this goal by facilitating communication with the coffee machine or keeping the brewed coffee warm upon brewing.
Two primary use cases and two secondary use cases for the EZ Coffee Brewer System are identified in the Use Case diagram. The primary use cases, Brew Coffee and Set Up Coffee Machine, are of highest interest to the user for the purpose of brewing coffee. The Brew Coffee use case encompasses the semantics of the process completed by the machine to successfully brew a cup of coffee. This includes heating the water, displaying the time remaining for brew, and indicating when the brew has completed. The Set Up Coffee Machine use case encompasses all steps pertaining to preparing the coffee machine for brewing, such as pairing the machine to the cellular device, filling the machine with water, placing coffee grounds into the coffee filter, and likewise placing the coffee filter into the filter holder.
Importantly, the secondary use case Warm Coffee is optional, as the user is not required to reheat the brewed coffee after brewing has been completed. Warming the coffee is accomplished by the Warmer Plate actor. This use case may be of interest to the user if they wish to keep their coffee warm for prolonged periods of time or reheat coffee at a later time. The secondary use case Process Phone Application Commands is used by both the Brew Coffee and Set Up Coffee Machine use cases when the phone application is used to accomplish or initiate either task.
Use Case Scenarios
This section details the two scenarios written for the two primary use cases. The primary use cases, Brew Coffee and Set Up Coffee Machine, are initially referenced in the use case diagram above.
Use Case Scenario 1
Use Case Scenario 2
Class Model
The class model displays all components of the system as object classes. Additionally, the model displays the attributes and behaviors of each class, as well as the interactions between each object. The Coffee Machine class is shown in the center of the model, which represents the physical coffee machine. Because the coffee machine is an aggregation of several components, the Warmer Plate, Water Scale, Light Indicator, Coffee Machine Display, Water Strainer, and Filter holder are all aggregates of the Coffee Machine.
Classes pertaining to the user interface are generally shown in the top left of the model. Here, the User class is shown as having the Smartphone App, which likewise depends on the Bluetooth System in order to function properly. The User gives a Command through the Smartphone Application, which contains the instructions that the Coffee Machine is expected to perform. These instructions might include set-up or brew instructions, such as brew scheduling.
Inheritance is shown through both the Button parent class and the Coffee parent class. The Button class shows the basic functionality of a button and contains more specific button subclasses: Brew Button, Coffee Selection Buttons, and On/Off Button. The Brew Button is pressed by the user to begin brewing. The Coffee Selection Buttons are pressed by the user to select a coffee strength level to be used to suggest a coffee ground weight to the user. Lastly, the On/Off Button turns the system on or off. The Coffee parent class contains the attributes of the brewed coffee itself and contains three subclasses representing the different strengths of coffee: Strong Coffee, Normal Coffee, and Very Strong Coffee.
Context Diagram
The Context Diagram shows seven different sources and sinks all giving or receiving data from the EZ Coffee Brewer system. The Phone App component acts as a source and a sink. It gives App Input data to the system and retrieves System Status data to then display in the app. The Brew Button source passes button input data to the system. The Display sink retrieves Display Data that is then given to the user via the display on the Coffee Brewer system. The Water Scale source weighs the water and provides the scale readings to the system. The Water Heater and Light Indicator sinks pull command and status data from the system. The Warmer Plate acts as both a source and a sink. It provides the status of the Coffee Pot to the system (i.e. whether it’s placed or not) and pulls out command data on how it should function.
The Context Diagram is a Level 0 Data Flow Diagram. It is a top-down view of the data flowing into and out of the system. This model allows a view of how each component of the system passes data and/or receives data.
Data Flow Diagram (Level 1)
The Process Input Data process takes inputs from the Phone App and the Brew Button. It takes this data and reformats it for the Process Display Data and the Process Command Data processes. This newly reformatted data can then be used in these other processes in a way each can understand. The Process Sensor Data process works very similarly; however, it receives input from the Water Scale and Warmer Plate. The Process Display Data process takes the input data and sensor data and converts it into readable data by the Display Screen and Phone App. This newly converted data is to allow the User to understand a multitude of things, especially how much longer until their coffee is ready. The Process Command Data command is used to take the Input Data and Sensor Data and convert it into useable commands that the Water Heater, Warmer Plate and Light Indicator can use.
The Data Flow Diagram (Level 1) is a more in-depth look at the Context Diagram. It breaks down the overall System into different processes on a direct next level. To provide more information the Data Flow Diagram could be broken up into more levels that show each process individually.
Statechart Diagram
The Statechart Diagram displays the many states of the system and how they’re interacted with. This diagram shows how to navigate through each one and what each state does while active.
When the On Button is first pressed, the machine enters an idle state. In this state nothing happens. In this state the machine is waiting for additional inputs. From here the machine can enter a pairing state, in which it pairs wirelessly to the phone app, or it can enter a weighing water state, in which the user has poured water into the system and is ready to brew, or the machine can enter a warming coffee state, in which the user has already made coffee and wishes to warm it after brewing is complete. From the weighing water state, the machine can enter directly into the brewing state or the brewing scheduled state if the user wishes to delay the brew time. While brewing, if the coffee pot is ever removed, the system will enter a waiting state, making sure the coffee pot is present before continuing the brewing. After brewing the coffee, the machine will enter the warming coffee state. From here the machine can either go into the idle state or be turned off by the user.
Identified Classes and Contracts
The identified classes of the design are as follows:
1) Coffee
2) PhoneApplicationInterface
3) BluetoothSystem
4) Command
5) WaterScale
6) WarmerPlate
7) WaterStrainer
8) FilterHolder
9) Buttons
10. OnOffButton
11. CoffeeSelectionButton
12. BrewCoffeeButton
13) LightIndicator
14) CoffeeMachineDisplay
15) CoffeeScheduler
The identified contracts of the design are as follows:
1. Pair phone application to the coffee machine (PhoneApplicationInterface)
2. Schedule coffee brew through the phone application (Command)
3. Weigh water (WaterScale)
4. Suggest amount of coffee grounds (CoffeeMachineDisplay)
5. Brew coffee (CoffeeScheduler)
6. Select coffee strength (Coffee)
7. Warm pot (WarmerPlate)
8. Update phone application on machine status (PhoneApplicationInterface)
9. Indicate brewing is completed through light indicator (LightIndicator)
10. Indicate brewing is completed through cellphone application (PhoneApplicationInterface)
11. Check coffee is ready to brew (Coffee)
12. Send state of filter holder (FilterHolder)
13. Send state of water strainer (WaterStrainer)
14. Facilitate communication between phone application and coffee machine (Bluetooth System)
15. Send pressed state (Buttons)
Classes, Responsibilities, and Collaboration Cards
By combining the identified classes and the contracts, the following CRC cards and the corresponding responsibilities of each class are generated.
Collaboration Diagram
The collaboration diagram shown below reflects the CRC card design. The same classes and contracts are shown as represented by the CRC cards. The collaboration diagram provides a visual representation of the CRC cards to aid in visualizing and understanding the design presented. Additionally, the collaboration diagram effectively displays the interactions between classes, showing where each collaboration occurs.
Subsystem Diagram
The collaboration diagram may be simplified into a subsystem diagram as shown. Importantly, the collaboration diagram is split into four subsystems: Coffee Brewer Components Subsystem, Phone Application Subsystem, Coffee Machine Interface Subsystem, and Coffee Subsystem.
The Coffee Brewer Components Subsystem encompasses all physical components of the coffee machine used in brewing. Namely, these components are the FilterHolder, WarmerPlate, WaterScale, and WaterStrainer.
The Phone Application Subsystem encompasses all classes relating to the phone application user interface. These classes are Command, PhoneApplicationInterface, and BluetoothSystem.
The Coffee Machine Interface Subsystem encompasses all classes relating to the user interface that is directly present on the physical coffee machine. The user may choose to brew coffee directly on the coffee machine without needing to interface with the cellphone application. The classes included in the Coffee Machine Interface Subsystem are the Buttons classes, CoffeeMachineDisplay, and LightIndicator.
Lastly, the Coffee Subsystem encompasses the logic regarding the coffee brewing itself. This subsystem contains the two classes related to coffee brewing: CoffeeScheduler and Coffee.
This webpage details the successful analysis and design of the EZ Coffee Brewer system. The work detailed in this webpage involved multiple revisions and iterations to achieve consistency with both the problem statement and other created models, and several challenges were seen throughout the process. Interestingly, the team retains confidence that the unique design may be successfully implemented in future stages of the project.
The biggest challenge faced by the team was ensuring agreement between the different models, such as making certain that the process indicated through the statechart diagram agreed with the steps for coffee brewing indicated in the use case scenarios. Additionally, this was the first time the team received exposure to both analyzing and designing a system from one given problem statement from start to finish, and it therefore took a significant amount of time to ensure correctness, especially with the design models. If the team were to receive a new problem statement, there is significant certainty that the process would be expedited.
The CRC process was particularly challenging due to the complexity of the system. Although the domain of the system was well scoped, the collaboration diagram nonetheless contained a high number of interdependencies and identified classes, which emphasize the complexity of the system. As additional classes were added to the CRC cards whenever necessary, the complexity of the design continued to grow. However, the team successfully documented the design and ensured both completeness and agreement between the CRC cards, the collaboration diagram, and the subsystem diagram.
If the project were to be completed again with a new problem statement, the team would spend additional time increasing the cohesion and decreasing the coupling of the design in particular. The relatively high amount of coupling in the collaboration diagram is manageable and implementable, but clearly retains room for improvement.