rodchar formulated the question :
hi all again,
i could reaally use a property in one of my classes but this property would
not be of any use in another one of my classes that also implement this
interface. is it ok to go ahead and add it?
if so, how would you handle this property in the class that has no use for
it?
thanks,
rod.
The interface specifies a "minimum" number of methods and properties,
so you can add any number of methods/properties that are not covered by
the interface. But this also means that when you use the class via the
interface, you can't use that property.
If you want to specify that extra property *as part of* the interface,
then *every* class that implements that interface should implement that
property. As far as the compiler is concerned, a "throw
NotImplementedException();" is a good implementation, only your code
will receive that exception when it uses the "wrong" class through that
interface.
But if the other objects can't provide a meaningful implementation,
then that property probably does not belong in the interface.
Hans Kesting