Superclass property implementation cc4m_logo_inline

IDFCNS-23
TitleClasses shall not implement properties inherited from superclasses.
PriorityMandatory
Severity level1
DescriptionClasses shall not implement concrete properties that are inherited from a superclass. In order to assign default values to concrete properties inherited from a superclass, assign the values in the constructor of the subclass, or make the properties Abstract in the superclass.
RationaleAttempting to use such a class will result in a runtime error.
ExceptionThere are two separate conditions under which you can redefine superclass properties:
The inherited property is abstract.
The values of the superclass property SetAccess and GetAccess attributes are private.

Avoid:

classdef Measurement
    properties
        measurementDate
    end
end

classdef Pressure < Measurement
    properties
        measurementDate = today()
    end
end

Instead use:

classdef Measurement
    properties
        measurementDate
    end
end

classdef Pressure < Measurement
    methods
        function obj = Pressure()
            obj.measurementDate = today();
        end
    end
end