Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2006

Tip: Looking for answers? Try searching our database.

Is this an example of Polymorphism?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jm - 31 Oct 2006 19:55 GMT
I was reading about the provider model and found that providers have a
definition, the contract, that all provider implementations must have.

Is this an example of polymorphic behavior because there is a
definition (either an abstract class or an interface) and each
implementation has a different behavior for the same method (the same
method they must all have)?

So, I have a provider model/definition, or whatever is the correct
thing to call it.  In that definition it says that anything that
inherits from the provider class (again, or whatever it is called) must
have a GetData (guessing) that has certain parameters (virtual).

In the implementation, I have an Oracle provider that has a override
GetData and in its Oracle model it does whatever to get data back from
the Oracle database.  Sql Server, MySQL, and so on also have an
override GetData method that implements a particular version of the
inherited provider class.

Again, is this polymorphism?

Thank you.
Peter Bromberg [C# MVP] - 31 Oct 2006 20:12 GMT
From the quintessential Wikidpedia entry:
"polymorphism (object-oriented programming theory) is the ability of objects
belonging to different types to respond to method calls of methods of the
same name, each one according to an appropriate type-specific behaviour. The
programmer (and the program) does not have to know the exact type of the
object in advance, so this behavior can be implemented at run time "

In short, yes, you described polymorphic behavior.
Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> I was reading about the provider model and found that providers have a
> definition, the contract, that all provider implementations must have.
[quoted text clipped - 18 lines]
>
> Thank you.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.