Relations define how models relate to each other.
For example, it makes sense that customers place orders. This indicates that we should have a relationship between the customer model and the order model. It also makes sense that each order should contain of a number of articles, meaning we should probably also have a relationship between the order and article models.
Every relation has a cardinality that describes how the relation can be bound. For example, a customer can place several orders, but each order can only ever have one customer associated with it (the customer who placed the order).
- Names: The names of the relation on the two models. The name is only an identifier that is used when referring to the relation. (For example, customer, order, car, owner.)
- Ownership: Indicates if one of the models is the owner of the other model. A related model cannot exist without its owner. (For example, an order cannot exist without a customer.)
- Cardinality: Indicates how many records of a particular model the relation can refer to. (For example, a customer may place many orders, but an order can only have a single customer.)