Subtyping groups the common attributes and relationships of entities, while retaining what is special within each entity. Subtyping is an excellent way of communicating that certain concepts are very similar and for showing examples.

In our publishing data model, an Author may write many Electronic Titles and many Print Titles, as illustrated in Figure 7.7.

Figure 7.7 Author may write many Electronic Titles and many Print Titles

·         Each Author may write one or many Electronic Titles.

·         Each Electronic Title must be written by one or many Authors.

·         Each Author may write one or many Print Titles.

·         Each Print Title must be written by one or many Authors.

Rather than repeat the relationship to Author, we can introduce subtyping, as shown in Figure 7.8. The subtyping relationship implies that all of the properties from the supertype are inherited by the subtype. Therefore, there is an implied relationship from Author to Electronic Title, as well as from Author to Print Title. Not only does subtyping reduce redundancy on a data model, it makes it easier to communicate similarities across what otherwise would appear to be distinct and separate concepts.

Figure 7.8 Author may write many Titles

·         Each Author may write one or many Titles.

·         Each Title must be written by one or many Authors.

·         Each Title may be either an Electronic Title or Print Title.

·         Each Electronic Title is a Title.

·         Each Print Title is a Title.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset