Override .NET virtual properties
- Last Updated: January 26, 2026
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
ABL allows you to override properties defined with the
virtual
modifier in .NET super classes. The following rules apply when overriding .NET
virtual properties:- The data types of the subclass and super class properties must be compatible.
- The overriding property in the subclass cannot have a more restrictive access
mode than the property in the super class. For example, if the super class
property is
PUBLIC, then the subclass overriding property cannot be markedPROTECTED. This rule applies to the property itself and the specified accessors (GET/SET). - You can override a property that is marked
virtualas long as it is not markedsealedlower in the hierarchy.
For information on overriding ABL properties, see Override properties within a class hierarchy.
Example
The following example code shows a property being overridden.
class1 is a .NET class with a virtual property called myProp.
class2 inherits class1 and myprop is overridden. The
example also illustrates that you can use the SUPER
system reference to access the property in the super class.
|
|