Principles of Object Oriented Database Design
Principles of Object Oriented Database Design
net/publication/2263511
CITATIONS READS
4 789
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Bernhard Thalheim on 19 February 2014.
3 Class Abstraction
As we have seen in Section 2 the structure expression of a class in an OODM schema may
contain parameters. These arise from parameterized types. Parameterized classes allow
to abstract from concrete structures. Indeed, an instance of a parameterized class may
not be regarded as a single set of pairs, but as a family hereof indexed by the possible
instantiations. Let us now extend and concretize this view to arbitrary schemata.
If we know that objects will have some attributes, but we still do not know the type
of the corresponding values, we may leave the corresponding parameter uninstantiated.
However, if we already know that we shall instantiate this parameter by some type,
we may mark this parameter as a type parameter . If we know that there will be some
reference ri : Ci, but Ci is unde ned, then we have a class parameter .
For parameterized classes the possibilities to de ne methods and constraints are
restricted. If is a type parameter and we do not know anything about the type,
there is no non-trivial way to express a term of that type, but terms are required in
assignments as well as in constraints. However, we may have partial knowledge of that
type, e.g. that it is a subtype of some other type, in which case we may use terms of
that supertype.
If C is a class parameter, then each call of a method m on C is indeed unde ned.
Therefore, for the proof of properties of the calling method such as consistency we
only have the possibility to assume an arbitrary input-output-relation for m unless we
completely defer the proof.
De nition7. If S is a schema, T a type parameter, C a class parameter and M
an unde ned method. A parameter restriction is either T T 0 with some value type
expression T 0, C isa C 0 with some class name C 0, C:structure S with some structure
expression S or a restriction on the types of the signature of M .
Here denotes the subtype relation and its canonical extension to structure expressions.
Note that some parameter restrictions may be inferred from context in the schema S .
If a parameter is unrestricted, we may add the implicit parameter restrictions T ?,
C:structure ? and Ti ? for type parameters, class parameters and types in
method signatures. However, if there is more than one restriction on a parameter, these
may be inconsistent. In the case of a consistent set of parameter restrictions, the set of
restrictions on one parameter may be uni ed to give only one restriction in the form of
De nition 7. We then talk of the normalized set of parameter restrictions .
In order to de ne the semantics of open (i.e. not closed) schemata, we need the
notions of instantiations.
De nition8. Let S be a schema with a consistent set of parameter restrictions. An
instantiation I is given by a closed schema S 0 that results from S by replacing each
type parameter T by a value type, each class parameter by a class and each unde ned
method by \ Let : : : oi :: Oi : : : " such that all parameter restrictions are satis ed. S 0 is
called minimal i we had taken the types and classes occurring in the normalized set
of parameter restrictions.
Example5. Let us look again at Examples 1-4. The minimal instantiation of the type
V Z (and V Z 0) gives
VZ =
Type
( begin : ? ,
end : ? ,
kind-of-insurance : \Main" j \Family" j \Interruption" )
End VZ
The minimal instantiation of the class Insurant leads to the structure expression
Structure ( contract-no : NAT ,
name : ? ,
address : ? ,
sex : ? ,
insurance-times : VZ-list ,
agency : ? )
The method add-insurant involves the call of check-data on the same class, but this
method is unde ned, hence could only be treated as the non-deterministic value selec-
tion \ Let accepted :: BOOL ". ut
Finally, the full semantics of an open schema S is given by families of history sets
indexed by the possible instantiations of S , whereas the minimal semantics is the
semantics of the minimal instantiation.
Note that each instantiation can be projected naturally to the minimal one. The
principle of class abstraction is necessary for stepwise re nement as indicated in Section
3, since otherwise we were not able to support partial designs. On the other hand,
it increases the band-width of possible concrete designs that occur as instantiations.
Therefore, it is desirable to provide libraries of abstract (partial) designs to achieve a
higher rate of reusability.
4 Stepwise Re nement
Once, an initial OODM schema is given, the following design process is based on step-
wise re nement. Roughly speaking, re nement means the reorganization of classes and
methods such that the semantics of the old schema is \preserved" within the new one.
This is captured by the next de nition.
Let S and T be closed schemata and suppose there are (partial) functions
{ finst that is total taking instances of T to instances of S ,
{ fclass that is partial taking a class in T to a class in S and
{ fmeth that is total taking a method in T to a (possibly empty) set of methods in S .
such that for each method M associated with a class C in T each method M 0 2 fmeth (M )
is associated with fclass(C ). If S and T are arbitrary schemata, assume these functions
to be de ned on the minimal instantiations.
De nition9. T is a re nement of S i for each pair (Di?1 ; Di) in a database history
of T that corresponds to a method M and each M 0 2 fmeth (M ) that is de ned and
terminating in finst (Di?1 ) the pair (finst (Di?1); finst (Di)) corresponds to M 0.
There exists a more elegant (but also strongly theoretical) characterization of re ne-
ment. We omit the details here. In [15] the following standard re nement steps in the
OODM have been discussed on the basis of an application example.
4.1 Instantiation
In Section 3 we discussed the possibility of parameterized (open) schemata and de ned
their semantics. Re nement by instantiation provides de nitions for such parameters,
but may also introduce new parameters.
Example6. Let us instantiate the type parameters ADDRESS and AGENCY oc-
curring in Example 3.
Type ADDRESS =
( zip : NAT Where self < 100; 000 ,
city : STRING ,
street : STRING )
End ADDRESS
Type AGENCY =
( number : NAT Where self < 1; 000 ,
address : ADDRESS ,
phones : f TELECOM NO g ,
fax : TELECOM NO ,
cares for : f ( zip : NAT Where self < 100; 000 ,
city : STRING ) g )
End AGENCY ut
Re nement by instantiation may also introduce bodies for methods that were unde ned
so far.
4.2 Splitting
Re nement by splitting leads to new classes with structure expressions that correspond
to parts of an existing structure expression which in turn are replaced by references. It
is mainly used in the case of shared data.
Example7. The class Agency stems from splitting Insurant in Example 3 assum-
ing the instantiation of Example 6 to be already done. The new reference is agency :
Agency.
Class Agency =
Structure ( agency : AGENCY )
End Agency
Class Insurant =
Structure ( contract-no : NAT ,
: : :: : : ,
agency : Agency )
Methods : : :
End Insurant ut
Clearly, the existing methods on the splitted class have also to be changed.
4.3 Specialization
Re nement by specialization introduces subclasses and subtypes. Moreover, it may
involve to replace a structure expression such that the new representation type will be
a subtype of the old one and the new implicit constraints will imply the old ones.
Example8. Let us introduce a new class Main-Insurant as a subclass of Insurant.
Objects in this subclass have an additional reference to Company that need not exist
for all insurants.
Class Main-Insurant =
IsA Insurant Structure ( account-no : NAT ,
employed-by : Company )
Methods : : :
End Main-Insurant
The new class Insurant results by specializing the old class with this name. We simply
add a reference to the class Main-Insurant for the case of insurant of kind \Family".
The corresponding subtype function is a simple projection.
Class Insurant =
Structure ( : : : ,
insurance-times : [ ( begin : DATE ,
end : DATE [ ? ,
( kind : \Main" j \Interruption" ) [
( kind : \Family",
associated-with : Main-Insurant ))]
Where : : : ,
agency : Agency )
Methods : : :
End Insurant ut
4.4 Extension
Re nement by extension is very simple, since it means the de nition of new types,
classes, constraints or methods that do not yet exist in the schema.
Example9. A new class New Insurant to capture persons that apply to become
an insurant is introduced as follows.
Class New Insurant =
Structure ( name : NAME ,
address : ADDRESS ,
sex : SEX ,
when to start : DATE ,
initial-agency : Agency ,
vocational-group : VOCATION-KEY ,
income : NAT Where self < 1; 000; 000 )
Methods : : :
End New Insurant
Objects may at the same time belong to both class Insurant and New Insurant
with di erent names, addresses and so on. Object identi ers are used to relate di erent
aspects of the same object. ut
Assume such an initial design and all re nements to be kept in some library. Omitting
account-no, employed-by and agency in the structure expression above would give a
common supertype of the representation types for Insurant old and Insurant in
Example 3.
Then build variants of all the existing re nements just omitting this information and
check whether these are compatible with the new requirements. This avoids repeating
re nement steps that occurred (in modi ed form) already in the past.
Finally, specialize Insurant as indicated in Example 8 and build variants of the
re ned classes Insurant and Main-Insurant with respect to the hierarchy developed
so far. Again this should avoid repeating earlier re nement steps. ut
The concretization and theoretical treatment of these ideas for the outlined methodology
is a research issue under current investigation.
References
1. M. Atkinson, F. Bancilhon, D. DeWitt, K. Dittrich, D. Maier, S. Zdonik: The object-
oriented database system manifesto , Proc. 1st DOOD, Kyoto 1989
2. C. Beeri: A formal approach to object-oriented databases , Data and Knowledge Engineer-
ing, vol. 5 (4), 1990, pp. 353-382
3. G. Booch: Object-oriented design with applications , Benjamin Cummings, 1991
4. L. Cardelli, P. Wegner: On understanding types, data abstraction and polymorphism , ACM
Computing Surveys, vol. 17(4), pp. 471-522
5. S. Ceri, J. Widom: Deriving production rules for constraint maintenance , Proc. 16th Conf.
on VLDB, Brisbane (Australia), August 1990, pp. 566-577
6. P. Coad, E. Yourdan: Object-oriented analysis , Prentice Hall, 1991
7. C. Floyd: A comparative evaluation of system development methods, in T. W. Olle,
H. G. Sol, A. A. Verrijn-Stuart (Eds.): Information Systems Design Methodologies { Im-
proving the Practice, Elsevier 1986
8. P. Fraternali, S. Paraboschi, L. Tanca: Automatic rule generation for constraint enforce-
ment in active databases , in U. Lipeck, B. Thalheim (Eds.): Proc. 4th Int. Workshop on
Foundations of Models and Languages for Data and Objects, Volkse (Germany), October
1992, Springer WICS
9. R. Hull, R. King: Semantic database modeling: survey, applications and research issues ,
ACM Computing Surveys, vol. 19(3), September 1987
10. W. Kim: Object-oriented databases: de nition and research directions , IEEE Trans. on
Knowledge and Data Engineering, vol. 2 (3), 1990, pp. 327-341
11. B. Meyer: Object-oriented software construction , Prentice-Hall, 1988
12. B. Piza, K.-D. Schewe, J. W. Schmidt: Term subsumption with type constructors , in
Y. Yesha (Ed.): Proc. 1st Int. Conf. on Information and Knowledge Management, Bal-
timore, November 1992
13. G. Saake, R. Jungclaus: Speci cation of database applications in the TROLL language,
in D. Harper, M. Norrie (Eds.): Proc. Int. Workshop on the Speci cation of Database
Systems, Glasgow, July 1991, Springer WICS, pp. 228-245
14. K.-D. Schewe: Variant construction using constraint propagation techniques over semantic
networks , in J. Retti, K. Leidlmaier (Eds.): Proc. of 5th Austrian AI Conference, Igls
(Austria) 1989, Springer IFB 208, pp. 188-197
15. B. Schewe, K.-D. Schewe, B. Thalheim: Verfeinerungsschritte fur eine objektorientierte
Entwurfsmethodik , in Proc. 23rd GI-Jahrestagung, Dresden (Germany), October 1993
16. K.-D. Schewe, J. W. Schmidt, I. Wetzel: Identi cation, genericity and consistency in
object-oriented databases, in J. Biskup, R. Hull (Eds.): Proc. ICDT '92, Berlin (Germany),
October 1992, Springer LNCS 646, pp. 341-356
17. K.-D. Schewe, B. Thalheim, J. W. Schmidt, I. Wetzel: Integrity enforcement in object-
oriented databases , in U. Lipeck, B. Thalheim (Eds.): Proc. 4th Int. Workshop on Found-
ations of Models and Languages for Data and Objects, Volkse (Germany), October 1992,
Springer WICS
18. K.-D. Schewe, B. Thalheim, I. Wetzel: Integrity preserving updates in object oriented data-
bases , in M. Orlowska, M. Papazoglou (Eds.) : Proc. Australian Database Conference,
Brisbane (Australia), February 1993, World Scienti c, pp. 171-185
19. K.-D. Schewe, B. Thalheim: Computing Consistent Transactions , University of Rostock,
Preprint CS-08-92, December 1992, submitted for publication
20. S. Shlaer, S. J. Meller: An object-oriented approach to domain analysis , ACM Software
Engineering Notes, vol. 14 (3), 1989
21. C. Sernadas, P. Gouveia, J. Gouveia, A. Sernadas, P. Resende: The rei cation dimension
in object-oriented database design , in D. Harper, M. Norrie (Eds.): Proc. Int. Workshop on
the Speci cation of Database Systems, Glasgow, July 1991, Springer WICS, pp. 275-299
22. B. Thalheim: Dependencies in relational databases , Teubner, Leipzig 1991
23. B. Thalheim: Intelligent database design using an extended entity-relationship model, Uni-
versity of Rostock, Preprint CS-11-91, Dezember 1991