Slide 5

CSCI 201 Guest Lecture: Data Modeling


What is a data model? (cont.)

School Schedule Example (cont.)

In the entity-relationship model, notice that the professor and student entities have a duplicate attribute, "name." We can eliminate the duplication by extending the entity-relationship model to an object model by adding inheritance.

Now we call the entities objects. Add a "person" object and the "is-a" (inheritance) relationship (denoted by heavy gray arrow):


Object Model

The object model maps directly to C++ or Java code. Objects are class instances. Attributes are private data in the class. Relationships are aggregation of objects within classes. The arrow points away from the aggregating class.

Next page


Email: Richard dot J dot Wagner at gmail dot com

dm02c.htm, this hand crafted HTML file created October 18, 1997.
Last updated October 22, 2010, by Rick Wagner. Copyright © 2010, all rights reserved.