Hi, is there at all any way to provide a mechanism to limit certain attributes of a parent type which is part of an inheritance model from being inherited from a child type. For instance, to limit the type just use FINAL, although this cannot be used on an attribute of the type, im searching for a way to do so. is there any possible solution? ive checked the relevent lit on 9i - to no avail
Presumably if an attribute of a type were final, no valid child type could be created anyway.
Since that is a reasonable assumption, if an OO hierarchy exists with non-inheritable attributes, then the design is simply wrong.
It is possible that by final you mean to say that the attribute may be modified only by the parent, never by the children. If so, then create a private variable, assign public final setter methods to it, and the usual getter method. This way, the value can be changed only by the parent, never by the child. Yet it is accessible to everybody. Of course, this is applicable only to Java. In C++ you'd use "virtual" to let methods be over-ridden.
Is this a feature of other OO languages?
This is a feature of Java. Other OO languages, like Python and Ruby, do not have the concept of private variables.
As far as I know, there is no way of doing this in current databases, especially since this design would be simply wrong.