S
Sean Chambers
Not sure if this is the correct way to go about this, but it seems
correct. I'm trying to eliminate dependencies through interfaces and
want to minimize casting as much as possible, as a result I have
interface inheritance setup like so
Here's my class setup:
BlogPost : IBlogPost
PodcastPost : BlogPost, IPodcastPost
IPodcastPost : IBlogPost
Class Blog
- has reference to IBlogPost
Class Podcast
- has reference to IPodcastPost
Now, If I pass around an instance of PodcastPost to methods that accept
IBlogPost, will it require
a cast? This inheritance structure seems a little complex, but then on
the other hand in my unittests, it seems to be accomplishing everything
I need it to.
Is this too confusing?
thanks
Sean
correct. I'm trying to eliminate dependencies through interfaces and
want to minimize casting as much as possible, as a result I have
interface inheritance setup like so
Here's my class setup:
BlogPost : IBlogPost
PodcastPost : BlogPost, IPodcastPost
IPodcastPost : IBlogPost
Class Blog
- has reference to IBlogPost
Class Podcast
- has reference to IPodcastPost
Now, If I pass around an instance of PodcastPost to methods that accept
IBlogPost, will it require
a cast? This inheritance structure seems a little complex, but then on
the other hand in my unittests, it seems to be accomplishing everything
I need it to.
Is this too confusing?
thanks
Sean