UCL Logo

SnackBar UML Class Diagram

This is the design-level UML Class diagram:

The '+' symbol before a method name means that the method is public, while a '-' sign means the method is private. If a method has a return type it is specified after the parameter list, otherwise the method is void. Note that the syntax for return types and for method parameters is not Java syntax but it is reasonably similar and can be translated directly to Java syntax.

Constructors are marked with the stereotype <<constructor>>. Stereotypes are used to extend UML so that more precise information can be given in a diagram. The <<constructor>> stereotype makes clear that a method is a constructor method, rather than an ordinary instance method.

As this is a design-level diagram, the associations between classes are navigable or uni-directional so they have arrow heads. This means, for example, that a SnackBar object has a reference to a Menu object but the Menu object does not have a reference to the SnackBar object. 

The associations are also labelled with the name of the instance variable used to hold the corresponding object reference. For example, the association between SnackBar and Menu is labelled '-menu', meaning that the SnackBar has a private instance variable called menu to allow a SnackBar object to reference a Menu object.

The dashed line between SnackBar and Order is a dependency relationship. This means that SnackBar makes use of Order but does not maintain a permanent association (this is no instance variable in SnackBar of type Order). The dependency is additionally labelled with the stereotype <<create>>, showing that SnackBar creates Order objects.

The dependency is shown to emphasise that Orders are created by a SnackBar when a new customer order is entered. There could also be a dependency between SnackBar and MenuItem but it is not included as it was not considered to convey any additional useful information in this particular diagram. Note, however to fully understand the SnackBar to Order dependency more information is needed, either in the form of additional diagrams and design documentation, or by reading the source code.

Last updated: September 2, 2006

Computer Science Department - University College London - Gower Street - London - WC1E 6BT - Telephone: +44 (0)20 7679 7214 - Copyright 1999-2006 UCL


 Search by Google