![]() Less suitable for incomplete subtyping - adding new child requires altering the existing table, which can be problematic in a production environment. Depending on your DBMS, child-specific constraints can be problematic. Cons: Some queries can be slower since they must filter-out "uninteresting" children.concrete parent (by just varying the CHECK). if you want to avoid different 2WD and 4WD vehicles having the same ID). Pros: No JOINing, so some queries can benefit.You can then have a CHECK to make sure the right subset of the fields in non-NULL. Put all classes in the same table and leave child fields NULL-able.There are generally 3 approaches for doing so: Unfortunately, practical databases don't directly support inheritance, so you'll need to transform this diagram to real tables. Neither IE nor IDEF1X directly allow specifying abstract vs. The following diagram from the ERwin Methods Guide (Chapter 5, Subtype Relationships) illustrates the difference: IDEF1X notation, on the other hand, doesn't (directly) recognize this difference, but it does differentiate between complete and incomplete subtype (which IE doesn't). The Information Engineering notation differentiates between inclusive and exclusive subtype relationship. incomplete: Do you expect more children to be added in the future? In your example, do you expect a Bike or a Plane (etc.) could be later added to the database model? exclusive: Can more than one child be instantiated for the same parent? In your example, can Vehicle be both 2WD and 4WD? 2 concrete: Can the parent be instantiated? In your example: can a Vehicle exist without also being 2WD or 4WD? 1 When doing subtyping, you are generally concerned with the following design decisions: ![]() This is the relational cousin of the OOP inheritance. inheritance, category, subclass, generalization hierarchy.). I'm not familiar with the one you are using, but it's clear enough you are trying to represent a subtype (aka.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |