Results 1 to 31 of 31

Thread: [RESOLVED] Inheritance and Polymorphism

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Inheritance and Polymorphism

    In VB.NET programming the "official" meaning of polymorphism is as Shaggy explained.

    http://msdn.microsoft.com/en-us/library/z165t2xk.aspx

    Quote Originally Posted by penagate
    I have a more cynical view than the people above: I believe, in general, that most programming concepts are more widely used than they are understood
    I have to agree with that. VB.NET programmers are using both inheritance and polymorphism all the time without even realising it. For instance, every time we use data-binding we are using polymorphism because, in WinForms, we can bind any object that implements the IList or IListSource interface. How many people bind data to a DataGridView in their first few weeks of VB programming without ever having heard of polymorphism or interfaces? Also, every single type we define inherits the Object class at least, so even the greenest newbie uses inheritance.

    I think that both are pretty much unavoidable in VB.NET, especially inheritance. I think that they are alsoboth not necessarily well understood except by those with considerable experience, especially polymorphism. Even those with intermediate experience levels often don't have a full understanding of the implications of polymorphism, even if they can put it to use. That's one of the great things about .NET programming: complex principles are so ingrained that they can be utilised without having to think to hard.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Inheritance and Polymorphism

    The way I was taught polymorphism in my degree was as Jenner described. That was in a java context though. In industry I've come across it more often as Shaggy described and that's usually been in a VB.Net or C++ context. That makes me think that the term isn't really properly defined and tends to get used slightly differently by different groups of programmers. That's just my impression though and one or the other might be 'official'. Oddly enough, it was that confusion that stopped me posting back about polymorphism - every time I tried I found I couldn't really articulate exactly what it was properly, let alone answer the questions Brent asked. Mind you, I guess that confusion goes some way to answering whether it's widely understood.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width