What are the differences and similarities between objects and literals in the ODMG object model?
The differences and similarities between objects and literals in the ODMG object model are:-
Objects and literals are the basic building blocks of the object model. The main difference between the two is that an object has both an object identifier and a state (or current value), whereas a literal has a value (state) but no object identifier. In either case, the value can have a complex structure. The object state can change over time by modifying the object value. A literal is basically a constant value, possibly having a complex structure, but it does not change.
An object has five aspects:
- identifier,
- name,
- lifetime,
- structure,
- creation.
There are three types of literal:
atomic, structured, and collection
The differences and similarities between objects and literals in the ODMG object model are:-
Objects and literals are the basic blocks of an object model.
a) Object has both object identifier and state, literal has no object identifier.
b) Object states can change over time by modifying object values; literal is basically a constant value that does not change.
c) Objects are identified by their OID whereas literals are identified by their value.
d) Object will have a lifetime it depends on whether the persistent object or transient object lifetime is not applicable to literal.
e) Copy of object results in shallow copy whereas literal result in logical copy objects and literal can be atomic or structured.
Comments
Post a Comment