60 likes | 71 Views
Explore the concepts of subclasses and multiple inheritance in modeling. Understand how objects in a class can have unique properties and how conflicts are resolved. Learn about subclasses in ODL and E/R diagrams.
E N D
Modeling Subclasses The world is not flat! Some objects in a class may have properties not shared by other members: Products Software products Educational products So --- we define subclasses (in ODL and in E/R).
Subclasses in ODL Interface SoftwareProduct: Product{ attribute Set<string> platform; attribute Set<integer> requiredMemory; } Interface EducationalProduct: Product{ attribute Struct Interval {integer begin, integer end} ageGroup; attribute string topic } The two classes also inherit all the properties of Product.
Multiple Inheritance Product Platforms required memory ageGroup topic Educational Product Software Product Educational-method Educ-software Product
How do we resolve conflicts? Rating (ATA) Product Platforms required memory ageGroup topic Educational Product Software Product Rating (ASA) Educational-method Educ-software Product Rating?
Subclasses in E/R Diagrams name category price Product isa isa Software Product Educational Product platforms Age Group
In ODL: Every object belongs to a single class In E/R: An entity may be spread out in multiple sets. name category price Product isa isa Software Product Educational Product platforms Age Group