Exercises
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7
Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14
Chapter 5
<<bicycleWInheritance>>
A bicycle can be childBike or adultBike in rider!
A bicycle has a height!
The range of a bicycle's height is double with values [5,30] !
<<bicycleWRiderOverride>>
A bicycle can be childBike or adultBike in rider!
A bicycle has a height!
The range of a bicycle's height is double with values [5,30] !
A childBike has a height!
The range of a childBike's height is double with values [5,10] !
An adultBike has a height!
The range of an adultBike's height is double with values [20,30]!
<<bookGenre>>
From the physical perspective, a book is made of a frontCover, a core, and a backCover !
A book can be biography or fiction in genre !
From the content perspective, a biography is made of historicalBackground and mainCharacterDescription !
<<bookWInheritance>>
cover can be red, green, or blue in color!
cover has a frequency!
the range of cover's frequency is double with range [0,100]!
red has a frequency!
the range of red's frequency is double with range [10,20]!
cover can be cardboard or paper in material !
cover has a thickness!
Note on Inheritance :
Inheritance proceeds by copying down variables, aspects and other specializations from a parent
to each of its grandchildren via the specialization. Local(special) overrides general (inherited) values except when the local rangeSpec is "unknownValue"
(If the variable already exists then it is not overwritten unless its range is "unknownValue".)
<<organization>>
From the organization perspective, a Company is made of an ExecutiveOffice, a ProductionDepartment, and a SalesDepartment!
From the personnel perspective, the ExecutiveOffice is made of a FirstOfficer and a SecondOfficer!
From the production perspective, the ProductionDepartment is made of an ExecutiveOffice, a WidgetMakingUnit, and a WidgetDesignUnit!
From the bottomOrganization perspective, the WidgetMakingUnit is made of an ExecutiveOffice !
From the bottomOrganization perspective, the WidgetDesignUnit is like the WidgetMakingUnit!
From the bottomOrganization perspective, the SalesDepartment is like the WidgetMakingUnit!
<<toppings>>
From the mult perspective, toppings is made of more than one topping!
A topping can be peperoni or pineapple in flavor!
From the mult perspective,a topping is made of more than one ingredient!
© Copyright 2007 - RTSync Corp. All Rights Reserved.