07-09-2014, 01:39 PM
The UML association
The UML association (ER term: relationship) is the way that two classes are functionally connected to each other.
Example: We want our customers to be able to place orders for the products that we sell, so we need to model the Order class and its association with the Customer. Notice that while the Customer class represents a physical “thing,” the Order class represents an event that happens in the enterprise. Both are equally valid class types. We will first describe the Order:
“An order is created when a customer decides to buy one or more of our products. We need to know when the order was placed (date and time), and which customer representative sold the order.”
The association between the customer and the order will tell us which customer placed the order. We will describe the association in natural language just as we described the classes, but we will also include information about how few (at minimum) and how many (at maximum) individuals of one class may be connected to a single individual of the other class. This is called the multiplicity of the association (ER term: cardinality), and we describe it in both directions.
“Each customer places zero or more orders.” (* in the diagram below means “many”, and any quantity more than one is the same as “many” in a database.)
“Each order is placed by one and only one customer.” (Bad English—passive voice—but makes sense!)
The UML association (ER term: relationship) is the way that two classes are functionally connected to each other.
Example: We want our customers to be able to place orders for the products that we sell, so we need to model the Order class and its association with the Customer. Notice that while the Customer class represents a physical “thing,” the Order class represents an event that happens in the enterprise. Both are equally valid class types. We will first describe the Order:
“An order is created when a customer decides to buy one or more of our products. We need to know when the order was placed (date and time), and which customer representative sold the order.”
The association between the customer and the order will tell us which customer placed the order. We will describe the association in natural language just as we described the classes, but we will also include information about how few (at minimum) and how many (at maximum) individuals of one class may be connected to a single individual of the other class. This is called the multiplicity of the association (ER term: cardinality), and we describe it in both directions.
“Each customer places zero or more orders.” (* in the diagram below means “many”, and any quantity more than one is the same as “many” in a database.)
“Each order is placed by one and only one customer.” (Bad English—passive voice—but makes sense!)
