Just trying to learn what is the best way to do it, I will try to explain my problem, it may seem a longer question, sorry for that,
I have a class Element, two classes Shape and Audio derives from it, further two classes Text and Image derive from Shape, and further class Video derive from Image. I need to implement a type property on each of these classes which must have a read-only nature as there is no sense of setting a type on any of these classes other than the actual type, for ex : a Type property on Image will always return a value Image and nothing else. So how do I implement this hierarchy which forces all classes to implement Type property? Each of these classes have their own functionalities other than base Element class which can be marked abstract, which will allow me to mark Type property as abstract which will force it to be implemented on derived class but only at one level, how do I enforce it be implemented on Video as well?
Please suggest me the best approach on this.
Thanks in Advance.
Create an interface which defines the Type property, make all classes that need to be forced to implement Type, inherit from this interface.