I usually prefer the first approach because it requires less code in the child classes.
However, I admit that the semantics of the second approach are clearer in a subtle way. Overriding a property says that "implementing this property is part of my identity." Passing a constructor argument has a different connotation: "I am setting a value in this other thing, which is simply my base class." It implies composition (has-a), not inheritance (is-a).
And you need to do different things if the Value property is used only in an abstract class?
In this case, you should definitely use the first (constructor-oriented) approach so that you can hide this implementation detail from subclasses.
Similarly, if you need to use a value in the constructor; as Mark noted , this is a real technical reason for using the first approach. Although it does not matter in this particular scenario, if someone later modifies the property override to use some other member variable in the derived class, you may have a subtle error at your fingertips.
source share