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!

Popular Pragmatic Bookshelf topics Top

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
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
mikecargal
Title: Hands-on Rust: question about get_component (page 295) (feel free to respond. “You dug you’re own hole… good luck”) I have somet...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
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

Other popular topics Top

DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New

Sub Categories: