Determining mappings
When you have arranged the data aggregates into a conceptual data structure, you can examine the relationships between the data aggregates. A mapping between two data aggregates is the quantitative relationship between the two.
The reason you record mappings is that they reflect relationships between segments in the data structure that you have developed. If you store this information in an IMS database, the DBA can construct a database hierarchy that satisfies all the local views, based on the mappings. In determining mappings, it is easier to refer to the data aggregates by their keys, rather than by their collected data elements.
The two possible relationships between any two data aggregates are:
- One-to-many
For each segment A, one or more occurrences of segment B exist. For example, each class maps to one or more students.
Mapping notation shows this in the following way:
Class ◄────────►► Student
- Many-to-many
Segment B has many A segments associated with it and segment A has many B segments associated with it. In a hierarchic data structure, a parent can have one or more children, but each child can be associated with only one parent. The many-to-many association does not fit into a hierarchy, because in a many-to-many association each child can be associated with more than one parent.
Related Reading: For more information about analyzing data requirements, see IMS Version 15.3 Database Administration.
Many-to-many relationships occur between segments in two business processes. A many-to-many relationship indicates a conflict in the way that two business processes need to process those data aggregates. If you use the IMS full-function database, you can solve this kind of processing conflict by using secondary indexing or logical relationships.
The mappings for the current roster are:
- Course ◄────────►► Class
For each course, there might be several classes scheduled, but a class is associated with only one course.
- Class ◄────────►► Student
A class has many students enrolled in it, but a student might be in only one class offering of this course.
- Class ◄────────►► Instructor
A class might have more than one instructor, but an instructor only teaches one class at a time.
- Customer/location ◄────────►► Student
A customer might have several students attending a particular class, but each student is only associated with one customer and location.