Reputation: 1
The documentation says
Abstract classes are essential to support Object Orientation without the typical spamming of the database with always empty auto-created clusters.
But it also says
A class that can't have instances
However, I would like to embed a list class B in class A, not have class A inherit from the abstract class B. Is this allowed? Example:
enter code here
propVal {
locType : ""
eleName : ""
...
values :[valueStamp]
}
valueStamp {
value : any,
stamp : actionStamp
}
actionStamp{
// various attributes that say who, when, where change was made
}
Is used in many classes keeping track of changes to various fields. They will never be used stand alone, but can't inherit because they can be used more than once in a class Sample parent class
classA{
helperAId:"",
helperAProps : embeddedList of PropVals,
helperBId : "",
helperBProps : embeddedList of PropVals
}
Upvotes: 0
Views: 449
Reputation: 12859
B
in a class type A
. This is perfectly valid and a much used construct. This is done using the EMBEDDED type.ActionStamp
class (or whatever you name it) and let your other classes extend it.The B
and A
classes can both extend this ActionStamp
classSo, using your example:
CREATE ABSTRACT CLASS propVal
...
CREATE CLASS A
CREATE PROPERTY A.helperAProps EMBEDDEDLIST propVal
...
Upvotes: 1