This article considers the simplification of entity-relationship diagrams by the use of meta-entities. Indexes to measure the effectiveness of simplification are suggested and described in the examples.
Description of the Approach
Every business process has the appropriate data that reflects this business process. The data model of this process reflects the business entities and functions of the process.
The functions of these business entities are reflected in the relations between the entities on the entity-relationship diagram of the data model of the business process. A multifunctional business process, in which each component plays several business roles, is reflected in the entity-relationship diagram, where each entity can have many relations with other entities.
Here are some examples of multifunctional business entities:
- Members of a Human Resources Management team: a manager, a supervisor, and an employee, may have a similar role in the management of human resources of the company, but may also have other job responsibilities, including the relations between each other on the basis of subordination. In the data model, they can be presented as the Company Staff Controller meta-entity, along with their individual entities on the same entity-relationship diagram.
- State and private property owners, on the one hand, perform their functions of owners of their property based on different business rules, and on the other hand, have a relation with each other. In the data model, they can be presented as the Owner of Property meta-entity, along with their individual entities on the same entity-relationship diagram.
- Different types of investors: an individual investor, a mutual fund, and a bank can be represented as the Investor meta-entity, along with their individual entities on the same entity-relationship diagram.
- A state, a city, a block, a building, and an apartment can be presented as the Place of Residence meta-entity, along with their individual entities on the same entity-relationship diagram.
Examples of the entity-relationship diagram, which have such multifunctional entities, are shown in the two charts below (entities are shown as circles, and relations are shown as lines).
Figure 1: 8 relations without meta-entities.
Each of the entities A, C, and D has a relation to each of the entities F and G. This allows the replacement of the entities A, C, and D by one Meta-Entity (Figure 2):
- The curved line of the meta-entity is shown circling the entities it covered;
- The covered entities are removed from the entity-relationship diagram.
Figure 2: 5 relations with meta-entities.
- Eliminates 6 relations (A-F, A-G, C-F, C-G, D-F, D-G), replacing them by 3 relations (A-Meta-Entity, Meta-Entity-F, Meta-Entity-G);
- Removes the entities C and D from the entity-relationship diagram because they are completely covered by the Meta-Entity;
- Leaves in place the entity A on the entity-relationship diagram because it has the relation A-H, which is out of the Meta-Entity scope;
- Adds the relation A-Meta-Entity to the entity-relationship diagram to show that the entity A is covered by the Meta-Entities for the Meta-Entity’s role.
This example shows that on an entity-relationship diagram:
- Entities can be completely covered and replaced by one meta-entity if this meta-entity is playing the same role as the entities – the entities C and D;
- An entity, which is covered by a meta-entity partially, just for one role, can save its own relation(s) for another role(s) – the entity A keeps the initial relation A-H, which is not covered by the Meta-Entity.
Furthermore, there may be occasions when:
- One entity, which plays several roles, can be covered by more than one meta-entity, if each meta-entity replaces one role;
- More than one meta-entity covers the same entities and the meta-entities’ connections on the entity-relationship diagram are the same – in this case, these meta-entities can be merged into one combined meta-entity which plays a combined role, but it can be done only if this combined role really has a business meaning.
A meta-entity implemented on logical and physical entity-relationship diagrams is a database table. Implementation of a meta-entity and covered entities in a database depends on how the meta-entity covers the entities:
- Usually, data in the meta-entity database table belongs to the covered entity and can be implemented by two columns in the table: one column contains a code of the entity, and the other column contains a unique code of a data row in the covered entity.
- If the entity is covered by the meta-entity completely, it can be excluded from the entity-relationship diagram, and data of this entity will be relocated into the meta-entity’s table instead of a unique code of the entity’s data row.
- If the entity on the entity-relationship diagram coexists with the covering meta-entity, the entity’s table will contain the primary key column(s) of the meta-entity, implementing the coverage relation.
Thus, the data in the meta-entity is regrouped from the representation of the business entity into the representation of the functional role. Semantics of this model are not hidden:
- Neither, when the entity, covered by the meta-entity completely, is excluded from an entity-relationship diagram, because data of the entity will be in the covering meta-entity with the same role as the excluded entity had;
- Nor, when the entity’s data, covered by the meta-entity partially, remains in the entity’s table on an entity-relationship diagram, because the meaning of the data is not changed.
As the meta-entity represents the entity on an entity-relationship diagram and contains the entity data (when it covers the entity completely) or link to the entity data (when it covers the entity partially), the relation between the meta-entity and covering entity means “similar-to” and has the cardinality of “one-to-one”. Such a relation reflects the process of simplification of the entity-relationship diagram using the meta-entity, where the meta-entity is similar to a parent, and the entity is similar to a child. The difference between the relationship “similar-to” and the relationship between two entities on the entity-relationship diagram (e.g. “one-to-many”) is in the level of relationship: the relation between two entities exists on the same level of generalization as the entities on the entity-relationship diagram; the relation “similar-to” exists between two levels of generalization: the meta-entity (a higher level) and the entity (a lower level). At the same time, it’s not the same as a relationship between a class and a superclass in the enhanced entity-relationship model, because the entity can have functions and play roles which are additional to the role of the meta-entity.
The Alternative Way to Simplify an ERD
Another way to simplify an entity-relationship diagram is to build several entity-relationship diagrams – each for a specific role or combination of roles. But in this case, the whole picture of the relationship between the entities – the integrity of model – will be lost, as shown in the example in the Figure 3, where each business entity plays only one role on one diagram.
Figure 3: Separation of the diagram from the Figure 1 for three diagrams.
The separation in the Figure 3 is made based on the relations of the entity A, and none of the relations are repeated on separate diagrams. Such an approach does not show the whole picture of the initial diagram (Figure 1), making it less effective in simplifying an entity-relationship diagram in comparison with the use of meta-entities (Figure 2).
Calculations of Efficiency of Meta-Entities / The Level of Entity Integration
The simplest calculation of the efficiency of the use of meta-entities will be the calculation of the Entity-Relationship Diagram Simplification Index (ERDSI):
(The number of relations on the entity-relationship diagram before using the meta-entities) /
(The number of relations on the entity-relationship diagram after using the meta-entities)
For example, in the Figures 1 and 2: ERDSI will be 8 / 5 = 1.6, which means that, after the use of the meta-entity, the entity-relationship diagram became 1.6 times simpler and 1.6 times more efficient in programs which will perform the functions of the entity-relationship diagram with the meta-entity because the number of implemented relations decreases.
For each simplified entity, the Simplified Entity Simplification Index (SESI) can be calculated:
((The number of the Simplified Entity’s relations before using the meta-entities) –
(The number of the Simplified Entity’s relations after using the meta-entities)) /
(The number of the Simplified Entity’s relations before using the meta-entities)
Based on the SESI, it is possible to find the minimum, the maximum and the average SESI for all entities on the simplified entity-relationship diagram. The SESI also shows the level of integration of the entity with meta-entities (1 means completely).
For example, in the Figures 1 and 2:
- SESI for entity A will be (3 – 1) / 3 = 2/3; that means entity A simplified on 2/3.
- SESI for entity D will be (2 – 0) / 2 = 1; that means entity D was simplified completely or eliminated.
Described calculations allow comparisons of the effectiveness of different ways of simplifying an entity-relationship diagram.
For example, there are two ways to simplify the entity-relationship diagram from Figure 1:
Figure 4: 5 relations with 1 meta-entity
Calculations show that ERDSI for the entity-relationship diagram from Figure 4 is equal 8/5 = 1.6, and for the entity-relationship diagram from Figure 5 ERDSI is equal 8/4 = 2. This means that the entity-relationship diagram from Figure 5 is simpler than the entity-relationship diagram from Figure 4, but this simplification was reached by using two meta-entities versus one.
Such calculations can be used during planning and management of the implementation of programs which will perform functions of an entity-relationship diagram with a meta-entity.
It is important to emphasize that only the calculations of efficiency, by themselves, cannot define means of simplification – the similarity of roles primarily defines which entities can be replaced by meta-entities, and the calculations indicate which identified ways are more efficient.
- The use of meta-entities makes an entity-relationship diagram of a multifunctional business process more readable because it reduces the number of entities and relations on the diagram without impacting the integrity of data model presentation.
- Data covered by the meta-entity and reflected in the meta-entity by additional columns may be completely removed from the other entity and then that entity may be removed from the entity-relationship diagram if it is void of columns.
- The meaning of data is not changed after the use of a meta-entity regardless of whether they are in the covered entity or in the covering meta-entity.
- The meta-entity and the covering entity have the relation, which means “similar-to” and has cardinality “one-to-one.”
- The efficiency of the use of meta-entities can be calculated as the indexes for the whole entity-relationship diagram, for one covered entity, and for all covered entities as an average value.
- These indexes can be used for choosing a better entity-relationship diagram and for further work with the diagram.
- Chen, Yi Shin, CS4710 Introduction to Database Systems – Enhanced-ER Data Model. p. Key Ideas of EER. Taiwan, National Tsing Hua University, Mar 13, 2007, [cited 2013 Jan 25]. Available from: http://www.cs.nthu.edu.tw/~yishin/Courses/CS4710/Handout/Session2%20-%20EER%20Model%20Handout.pdf
- David C. Hay, Enterprise Model Patterns, Technical Publications, LLC , Bradley Beach, NJ, 07720, USA, 2011, p. 181-220.
- Martin Modell, Data Analysis, Data Modeling and Classification, McGraw-Hill Book Company, New York, NY, 1992, chapter 8. [cited 2013 Jan 25]. Available from: http://www.martymodell.com/dadmc/index.html
- Walter Cazzola, Robert J. Stroud, Francesco Tisato, Reflection and Software Engineering (Google eBook). p. 28. Springer, Aug 25, 2000, [place unknown] [cited 2013 Jan 25]. Available from: http://books.google.com/books?id=dCpsE2b26oAC&pg=PA28&lpg=PA28&dq=meta+entity&source=bl&ots=_n1wL7VQNO&sig=RmqVt3ZHzOtOf31LurPijK97nqk&hl=en&sa=X&ei=VU_mUIL5BuXV0QGtlYHABg&ved=0CGUQ6AEwBjgK#v=onepage&q=meta%20entity&f=false