From Newsgroup: comp.databases.theory
On 2021-03-24, Derek Ignatius Asirvadem <
derek.asirvadem@gmail.com> wrote:
Nicola
In case you missed them. Could you please respond to these questions.
On Thursday, 18 March 2021 at 14:38:13 UTC+11, Derek Ignatius Asirvadem wrote:
On Tuesday, 16 March 2021 at 23:23:28 UTC+11, Nicola wrote:
Note that the "circularity" in that diagram is only apparent (ERD are
misleading).
So, why in heavens name, do professors teach ERD ?
I cannot speak for anyone else...
One reason is Chen's Entity-Relationship models are likely perceived as
easier to grasp for novices than something like IDEF1X. Whether that is
a correct perception, it can be debated. Another reason is probably just historical, due to the huge influence of Chen's seminal paper.
In a general setting, ERD is fine for teaching the basics of modeling: entities, relationships, generalizations. For someone who has never done
it, taking a description in a natural language and analyze it to distill
such concepts and put them in diagrammatic form is not a trivial task
(well, it's not trivial even for experts!). ERDs can be useful as
a gentle introduction to such topics.
ERD can be introduced without any background knowledge in databases
(although that is true about IDEF1X to some extent, when you are
teaching IDEF1X you are in fact teaching the Relational Model), and even
for purposes that are different from mapping into the Relational Model.
For instance, one may use ERDs in the context of programmingrCosay, to
design a game.
When it comes to using ERD vs IDEF1X for designing Relational databases,
my experience is as follows:
- when teaching ERDs, one also has to explain the rules to translate
them into the RM: this is a layer of accidental complexity that IDEF1X
completely eliminates.
- On other hand, when teaching IDEF1X one has to introduce a richer
language, so it doesn't take less time to teach than ERD; but I'd say
that it doesn't take much longer either, as some people might might
expect.
- Perhaps contrary to someone's opinion, IDEF1X models can be grasped by
novices: I have successfully taught IDEF1X to people without any
background in Computer Science and high-school level of acquaintance
with logic for a few years now.
- ERDs make it difficult or impossible to reason about keys effectively:
think split keys, for instance. Or common ancestor constraints. This
is one of my biggest issues with ERDs. If you are using them to design
a video game, that might not be a problem, but for mapping them into
the RM, well, they effectively cripple your design process.
- There are some aspects of ERDs that are *far* from intuitive. If you
have ever tried to explain ERD relationships of degree higher than two
(and especially how to constrain the cardinalities of the participant
entities), then IDEF1X seems a lot simpler!
I have recommended my colleagues to switch to IDEF1X without success
(but without insisting either, to be honest). I guess this is simply
because habits are hard to change and most textbooks do not use it. New generations pick up what they have been taught by previous generations.
Some may feel IDEF1X is "low-level" (too many details) compared to ERDs.
Or some may have criticisms along the lines of this analysis:
https://www.essentialstrategies.com/publications/modeling/idef1x.htm
Another issue may be that IDEF1X is not so popular in the industry
either, except for some sectors or in some geographical areas. E.g., it
doesn't seem to be so popular in Europe.
My main complaint with IDEF1X is the treatment of generalization
hierarchies, in particular the lack of a correct way to model a total
inclusive specialization (A must be one of B1, ..., Bn and it may be any
of B1, ..., Bn); the approach I have seen around (e.g., see Thomas
Bruce's book or ERwin's manual) does not cover such case in a sound way.
And the standard never mentions inclusive specializations, AFAICT.
Another thing: people who already know ERDs easily accept the
distinction between independent and dependent entities (which reminds
them of the distinction between ERD's strong and weak entities), but
they may not see what additional information identifying and
non-identifying relationships bring to the table ("If you drew all the relationships without dashed lines, you would still be able to interpret
your model in the same way"). I found it difficult sometimes to convince
them that such a distinction is important.
Another criticism about IDEF1X is the lack of many-to-many relationships (except in "Level 1"/"ER" diagrams), which sometimes makes it
awkward to read a relationship, because it is more natural to skip the intermediate associative entity. For instance, one might want to model
the following:
- a customer BUYS zero or more products;
- a product IS BOUGHT BY zero or more customers.
In IDEF1X, you'd do it like this:
+-----------+ +-----------+
| | | |
| Customer | | Product |
| | | |
+-----------+ +-----------+
| |
| |
| +-----------+ |
| | | |
+-----O| Purchase |O-----+
| |
+-----------+
How would you label the relationships? You might use:
- a customer PERFORMS (?) zero or more purchases;
- a product IS SOLD AS (?) zero or purchases.
But the most natural reading is as above, with "buys"/"is bought by"rCo
which does not mention purchases, though.
IMO, this is a valid criticism. Some additional (an)notation to pick out
"pure associative entities" (for a lack of a better term) might help.
Why, since we have had IDEF1X for Relational Data Modelling since
1983 (established and well-known international standard since 1993),
do professors suppress that, and instead rCLteachrCY; push; shove;
market; propagate the broken ERD, which is a pre-Relational artefact
?
I think I have answered this above, at least by providing my own
perspective.
In your model, each teacher must always be assigned to at least one
course. With
(a) such an (unrealistic) constraint, *and*
Why is that constraint rCLunrealisticrCY ? In the real world, it is
a common; even pedestrian, requirement. We have been implementing
such in Relational databases since 1983.
I was thinking more in terms of "department employees", one of whose
duties may be teaching (but they may not be teaching all the time). But
sure, you may think in terms of employees who teach (a subset of all the employees): then they must teach something, of course.
Nicola
--- Synchronet 3.21d-Linux NewsLink 1.2