Quote:
I am real newbie on this field... I am just wandering, in RDBMS
there was possibility to update table definition (add field)
and ther was no problems.
What in OODBs ???? If I change class definition,
what will happen with database objects ???? |
In xrdb, what happens is mostly upto the user/application. Copy and
paste the script shown below into app's input box and press submit
button. To view the data, expand tree node labeled person. Db handles
normalization, PKs and FKs to a large extent. The app, which fits on a
floppy, can be downloaded from www.xrdb.com
// Create person john who is 30.
(CREATE type inst *age)
(CREATE type inst *person & dir item it)
(CREATE person inst *john)
(CREATE john age +30)
// Create person mary who is female.
// mary need not have any attributes.
(CREATE person inst *mary)
// Add gender attribute to mary.
(CREATE type inst *gender)
(CREATE mary gender +female)
// Add gender attribute to john.
(CREATE john gender +male)
// Create a default for person instance
// who is male and 25.
(CREATE verb inst *defInst)
(CREATE person defInst *defPerson)
(CREATE defPerson gender male)
(CREATE defPerson age +25)
// Create person bob and only use def gender.
(CREATE person inst *bob)
(CREATE bob gender (defPerson gender *))
// Add default weight attribute to default person.
// Note: this doesn't affect john, mary or bob
// but application is free to do so.
(CREATE type inst *weight)
(CREATE defPerson weight +180)
// Find persons instances whose gender is the default.
// Finds john and bob.
(SELECT person inst * & * gender (defPerson gender *))