Some Patterns
- 1:N
-
- The company has many departments.
- We need to ask
- Can a company exist if there are no departments? (In this case yes)
- Can a department exist in several companies (No)
- Can a department exist with no company? (No)
- This is one to many , mandatory to optional.
-
- N:M
-
- Notice that a company has many parts from the form.
- Notice also that a part is supplied by many companies from the report
- So this is clearly an N:M relationship.
- Not all companies we deal with are suppliers, so a company is not required to have a part. (Optional)
- But a part must come from somewhere (required)
-
- ID Dependent
- Association pattern
- The Part report is supplemented with the Part Quotation Report
-
- Notice the addition of a quoted price.
- This price is not part of the company
- It is not part of the part (Different companies supply the same part_
- A new entity is required.
-
- They give another example
- a Client exists in a firm
- Each Client may have one or more projects
- An architect may be assigned to one or more projects
- So an Assignment is made which matches Clients to Projects to Architects.
-
- Multivalued Attribute Pattern
-
- Here a company has multiple phone numbers.
-
- How does this change things?
-
- How about this?
-
- Archetype/Instance Pattern
- An entity represents an instance of another entity
- Consider a university
- There is a catalog of courses
- There is a schedule of courses offered.
-
- Mixed Identifying and Nonidentfying Patterns
- Line Item
-
- We have a salesperson
- A customer
- An order connects both.
- But the order is made up of line-items
- Which connects it to an item.
-