In terms of interfaces, everything is correct. A property is a pair of methods. In the interface, we require a class that implements our interface to implement a property with the specified accessor, while not imposing any conditions on the presence or absence of the second accessor.
With the abstract class is a bit more complicated. When implementing an abstract property, we must specify the override keyword, indicating the compiler, that the property was declared in the base class, before such a property.
The syntax does not allow you to specify override for one particular accessor, but only for the entire property as a whole, therefore an accessor undeclared in the base class also receives an override label, but it cannot be overridden because it is not in the base class.
Thus, we have a contradiction: on the one hand, we are trying to add a heir to the class, which should not cause any problems, but on the other hand, following the syntax of the language, we are trying to redefine the nonexistent method, which quite naturally causes a compilation error.
The question of why it was done this way, I’ll leave the language specifications to the developers, in any case it’s unlikely that they will fix it in the near future, if they correct it at all, so it’s easier to take it as a “feature” of the language and just know about it.
How to work around a problem
One of the possible solutions to circumvent this "feature":
abstract class SomeClass { public int AnotherProperty { get { return GetAnotherProperty(); } } protected abstract int GetAnotherProperty(); } class InheritedClass : SomeClass { public new int AnotherProperty { get; set; } protected override int GetAnotherProperty() { return AnotherProperty; } }
Another option is to put a property into a separate interface and implement it in a derived class, then the problem seems to be solved by itself, but sometimes this solution is not acceptable, for example, if in an abstract class there are implemented methods using this property.
Well, the radical option is the rejection of the property as such, and a return to the classic methods GetXXX() and SetXXX(value) , this option is possible absolutely in any conditions and does not cause problems neither in interfaces nor in abstract classes, but worsens the readability of the code, Although this is certainly an amateur, in Java, for example, this is the only possible option, if lately there has not been a complete change in it.