Are you gonna eat that

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ebybymic (Talk); changed back to last version by Chen Qing)
 
Line 1: Line 1:
 
This design exercise is from the 224 exam, 2006. Bwahahahaha!
 
This design exercise is from the 224 exam, 2006. Bwahahahaha!
  
>== Requirements Statement ==
+
== Requirements Statement ==
 
Some people are allergic to foods such as peanuts, gluten or lactose.  Foods packages have labels that list ingredients, so that consumers can check that products are safe for them to eat.  However, this can be a slow and difficult task.  Gluten, for example, is found in wheat, barley, rye, and in products derived from them such as malt, vinegar, and thickeners.  A shopper checking ingredients might overlook something, with potentially serious or fatal consequences.
 
Some people are allergic to foods such as peanuts, gluten or lactose.  Foods packages have labels that list ingredients, so that consumers can check that products are safe for them to eat.  However, this can be a slow and difficult task.  Gluten, for example, is found in wheat, barley, rye, and in products derived from them such as malt, vinegar, and thickeners.  A shopper checking ingredients might overlook something, with potentially serious or fatal consequences.
  
Line 9: Line 9:
  
 
* The allergens or food aversions of concern.
 
* The allergens or food aversions of concern.
* Safe thresholds for each problem ingredient, e.g. zero peanut content, and < 200 parts per million gluten.
+
* Safe thresholds for each problem ingredient, e.g. zero peanut content, and < 200 parts per million gluten.
 
When shopping, a user first selects the set of relevant profiles, e.g. family members, or dinner party guests.  Thereafter, the user can check any product against the current set of profiles by supplying information that identifies the product, e.g. brand and product name.
 
When shopping, a user first selects the set of relevant profiles, e.g. family members, or dinner party guests.  Thereafter, the user can check any product against the current set of profiles by supplying information that identifies the product, e.g. brand and product name.
  
Line 17: Line 17:
  
 
Each AYGET installation (e.g. on a mobile phone) will keep a local copy of the whole database.  Whenever the user chooses, the latest data can be downloaded from the central server.  The server is not accessed at other times, and no personal configuration data is sent from client installations to the central database.
 
Each AYGET installation (e.g. on a mobile phone) will keep a local copy of the whole database.  Whenever the user chooses, the latest data can be downloaded from the central server.  The server is not accessed at other times, and no personal configuration data is sent from client installations to the central database.
 
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://ukowacaqo.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
----
 
=[http://ukowacaqo.co.cc CLICK HERE]=
 
----
 
</div>
 
  
 
== Question ==
 
== Question ==

Latest revision as of 03:22, 25 November 2010

This design exercise is from the 224 exam, 2006. Bwahahahaha!

Contents

Requirements Statement

Some people are allergic to foods such as peanuts, gluten or lactose. Foods packages have labels that list ingredients, so that consumers can check that products are safe for them to eat. However, this can be a slow and difficult task. Gluten, for example, is found in wheat, barley, rye, and in products derived from them such as malt, vinegar, and thickeners. A shopper checking ingredients might overlook something, with potentially serious or fatal consequences.

Further, labels do not reveal all details of concern to consumers. For example, pesticides, animal products, and genetically engineered produce need not be declared, while products such as alcohol, toothpaste and shampoo are not covered by food labelling laws.

A new software system, `AreYouGonnaEatThat`? (AYGET), will help consumers to know what is in packaged foods and other common supermarket items. AYGET will run on mobile devices such as PDAs and cell phones. A user will be able to configure AYGET by defining a profile for each person it needs to consider. A profile will specify:

  • The allergens or food aversions of concern.
  • Safe thresholds for each problem ingredient, e.g. zero peanut content, and < 200 parts per million gluten.

When shopping, a user first selects the set of relevant profiles, e.g. family members, or dinner party guests. Thereafter, the user can check any product against the current set of profiles by supplying information that identifies the product, e.g. brand and product name.

On mobile devices with digital cameras, AYGET will allow the user to photograph bar codes. The software will use Optical Bar Code Recognition (OBCR) to extract bar code numbers, saving the user from having to type in product identification information.

AYGET company employees will maintain a central database of food information. Information supplied by manufacturers will be entered whenever food products are introduced or changed. The system will record details of food products, including name, manufacturer (with contact information), brand, visible characteristics of each kind of package (e.g. size, colour), and bar codes. Ingredients and their amounts will be stored, of course. All known types of allergen and food aversions will be defined, and ingredients will be classified by the presence of these constituents.

Each AYGET installation (e.g. on a mobile phone) will keep a local copy of the whole database. Whenever the user chooses, the latest data can be downloaded from the central server. The server is not accessed at other times, and no personal configuration data is sent from client installations to the central database.

Question

Draw a UML class diagram suitable for a requirements specification of this system. Your diagram should correspond as closely as possible to the level of detail given in the description above, making reasonable deductions and assumptions. Include relationship multiplicity information, and any attributes and operations that are evident (or can reasonably be deduced) from the description.

UML-Diagram

AYGET.jpeg

Jason & TK's Attempt

The diagram below captures our first attempt at solving the "Are you gonna eat that?" problem. Our classmates reviewed this design, and questioned the existence of the following classes:

  • OBSW
  • Mediator
  • View
  • Profiles
  • ProductIngredient

The take-home message was "model the real world".

A UML class diagram of Jason & TK's first attempt at modeling this problem

Kris & Chen's Attempt

AYGET - Kris Chen.jpg

This is the design drawn out from last lecture's talk. We kind of worked out we need something between Ingredient and Allergen to hold the threshold of a given ingredient. The solution is to introduce a class called IngredientElement (might be a bad name...) which is used to describe an ingredientElement and the quantity for that description. It can be used to compose Allergen and FoodProduct. And Profile is consisted of list of Allergen. In the main AYGET class, the IsFoodElibigle method goes through the IngredientElements of the product itself against the Profile for the customer, ingredient name and quantity/threshold will be compared between them. The rest part of our design is quite similar with others who already posted here.

Personal tools