HTML and CSS Reference
In-Depth Information
Table 8-1. The Different UML Association Types
Symbol
Name
Description
Composite
This is when a parent owns the child, and the child
cannot exist without the parent. If the parent is
destroyed, the child is destroyed too. This is known
as a “contains a” relationship.
Aggregate
This is when the parent does not own the child, but
the child can exist without the parent. If the parent is
destroyed, the child will still exist. For instance, an
Actor can exist without a Movie . This is known as a
“has a” relationship. A child in an aggregate
association can only belong to a single parent entity
(i.e., an Actor cannot belong to more than one Movie ).
Association This is a loose association, meaning that there is no
ownership between entities and that they can exist
without each other. Each entity can be associated
with many other entities.
Next to the association line you will see either a 1 or 0..*. This is called
multiplicity. It indicates what the type of association is between each class. A 1
indicates that there is only one associated object, 0..* indicates that there are
zero or more associated objects.
In the example in Figure 8-2, an Actor only has one Movie , but a Movie has zero
or more Actor s. A Movie has zero or more Video s, but a Video can only have a
single Movie .
In general, a UML diagram will also never show getters and setters for attributes.
Using the previous model, you can begin to create your models for MoMemo.
Let's start with the smallest and most insignificant model, VideoSource .
The Video Source Model
The video source model is the simplest of all of the models used within the
MoMemo application. The video source model is used to store the different
video formats for a video. Rather than adding webm, mp4, and ogv attributes to
the Video model, it makes sense to associate the video with video sources for
flexibility.
Imagine a new mobile web browser has just been released with support for
several new formats. If you wanted to support those formats, you would need to
 
Search WWH ::




Custom Search