The E-R model can result problems due to limitations in the way the entities are related in the relational databases. These problems are called connection traps. These problems often occur due to a misinterpretation of the meaning of certain relationships.
Two main types of connection traps are called fan traps and chasm traps.
Fan Trap. It occurs when a model represents a relationship between entity types, but pathway between certain entity occurrences is ambiguous.
Chasm Trap. It occurs when a model suggests the existence of a relationship between entity types, but pathway does not exist between certain entity occurrences.
Now, we will discuss the each trap in detail address)
A fan trap occurs when one to many relationships fan out from a single entity.
For example: Consider a database of Department, Site and Staff, where one site can contain number of department, but a department is situated only at a single site. There are multiple staff members working at a single site and a staff member can work from a single site. The above case is represented in e-r diagram shown.
The problem of above e-r diagram is that, which staff works in a particular department remain answered. The solution is to restructure the original E-R model to' represent the correct association as shown.
In other words the two entities should have a direct relationship between them to provide the necessary information.
There is one another way to solve the problem of e-r diagram of figure, by introducing direct relationship between DEPT and STAFF as shown in figure.
Another example: Let us consider another case, where one branch contains multiple staff members and cars, which are represented.
The problem of above E-R diagram is that, it is unable to tell which member of staff uses a particular, which is represented. It is not possible tell which member of staff uses' car SH34.
The solution is to shown the relationship between STAFF and CAR as shown.
With this relationship the fan rap is resolved and now it is possible to tell car SH34 is used by S1500 as shown in figure. It means it is now possible to tell which car is used by which staff.
As discussed earlier, a chasm trap occurs when a model suggests the existence of a relationship between entity types, but the pathway does not exist between certain entity occurrences.
It occurs where there is a relationship with partial participation, which forms part of the pathway between entities that are related.
For example: Let us consider a database where, a single branch is allocated many staff who handles the management of properties for rent. Not all staff members handle the property and not all property is managed by a member of staff. The above case is represented in the e-r diagram.
Now, the above e-r diagram is not able to represent what properties are available at a branch. The partial participation of Staff and Property in the SP relation means that some properties cannot be associated with a branch office through a member of staff.
We need to add the missing relationship which is called BP between the Branch and the Property entities as shown.
Another example: Consider another case, where a branch has multiple cars but a car can be associated with a single branch. The car is handles by a single staff and a staff can use only a single cat. Some of staff members have no car available for their use. The above case is represented in E-R diagram with appropriate connectivity and cardinality.
The problem of the above E-R diagram is that, it is not possible tell in which branch staff member S0003 works at as shown.
It means the above e-r diagram is not able to represent the relationship between the BRANCH and STAFF due the partial participation of CAR and STAFF entities. We need to add the missing relationship which is called BS between the Branch and STAFF entities as shown.
With this relationship the Chasm trap resolved and now it is possible to represent to which branch each member of staff works at, as for our example of staff S003 as shown.
Related Articles (You May Also Like)