raels

raels

Creating Software with Modern Diagramming Techniques: is ERD correct? (page 89)

@ashleypeacock

There doesn’t seem to be a difference in the notion of independence between GENRE ->> TITLE_GENRE <<-- TITLE, and ACTOR -->> TITLE_ACTOR <<-- TITLE. Eliminating the title does not eliminate the actor nor the genre, and likewise for eliminating the actor or genre does not eliminate the title. TITLE_GENRE does’t explicitly include the primary key designation the way the TITLE_ACTOR model does. This seems to fly in the face of earlier statements defining the independence of relationships based on primary key.emphasised text

First Post!

ashleypeacock

ashleypeacock

Author of Creating Software with Modern Diagramming Techniques

@raels Thank you for reporting, I think this section needs a little bit of a clean up, and it doesn’t help the diagram is slightly wrong for TITLE / TITLE_GENRE / GENRE (it should be both PK/FK). The ACTOR / TITLE_ACTOR / TITLE one is correct though with its keys, so a mistake on my part to not make it the same on both in terms of keys!

I’ll try to clarify the wording though, as it’s not about eliminating so much, it’s about “uniquely identifying” (in the case of identifying) or not. Out of curiosity, did the eliminating come from this chapter, and if so what part? As the domain modelling chapter touches on this with regards to composite vs aggregate, but it’s quite different in an ERD and identifying / non-identifying doesn’t really map to composite and aggregate, so was just curious if perhaps that lead to some of the confusion too.

So if we take ACTOR / TITLE_ACTOR, it’s identifying because the TITLE_ACTOR can’t be identified without ACTOR. The keys are a good way to decide too, in that title_id is in the primary key for TITLE_ACTOR.

Then for non-identifying, it means they are linked, but the relationship is just a foreign key, and the parent entity’s primary key isn’t used in the child entity. We can see this in TITLE and REVIEW, where TITLE has an ID, and so does REVIEW, and they are both primary keys. However, REVIEW is linked to TITLE by a foreign key, but it’s non-identifying because TITLE can be identified without REVIEW and vice-versa (because a review might be against a title, but it might be against an episode or season, and then title_id would be NULL). Whereas in the case of TITLE and TITLE_ACTOR, we can’t identify the TITLE_ACTOR without TITLE.

To take it one step further and explain it more, if we said a REVIEW was only against a TITLE, and we changed REVIEW to have a composite primary key of review_id & title_id, then it becomes identifying.

Does that make it a little clearer? I will try to make it clearer in the chapter too, as I did go back and forth on a few different ways and wordings for this part of the chapter, so an area for improvement I think, so thank you again for highlighting!

Where Next?

Popular Pragmatic Bookshelf topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
EdBorn
Title: Agile Web Development with Rails 7: (page 70) I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Sub Categories: