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

yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
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
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1142 25765 758
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Sub Categories: