Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • I'm confused by your middle two paragraphs. What do you mean by 'sub-type'? I'm using interfaces, which are contracts, not implementations, and I'm not sure how your comments apply. What do you mean by 'no typing'? What do you mean by 'implied'? An IDog can do everything that an IAnimal can, but isn't guaranteed to be able to do more. Commented Jun 13, 2012 at 23:05
  • Thanks for the clarification. In my specific case, I'm not exactly using the interfaces differently. It can probably be best described by saying I have a Kennel class that stores a list of IDogs. Commented Jun 13, 2012 at 23:23
  • @KendallFrey: Either you're casting out of the interface (bad), or you're creating an artificial distinction that smells of an incorrect abstraction. Commented Jun 13, 2012 at 23:29
  • 2
    @Telastyn - Purpose of such as interface is that providing a metadata Commented Jun 13, 2012 at 23:36
  • 1
    @Telastyn: So how do attributes apply to compile-time checking? AFAIK, in C#, attributes can only be used at runtime. Commented Jun 13, 2012 at 23:46