|
-
Dec 4th, 2003, 01:23 AM
#5
Thread Starter
Frenzied Member
So I see...
Another question on a slightly different matter. As I strife towards designing good programs, I often try to use polymorphism as often as I can. And one way to implement polymorphism is to make use of interfaces.
For example, I have a method within a class that is called PrintResults (asp.net) which takes a datareader INTERFACE as in parameter, and then spit out the results with Response.writes...
I also have a method which is called GetResults, which fetch information from a database (with factory patter for dbconn) and store it in a datareader. I then return the INTERFACE of this datareader.
Is this the correct way to implement polymorphism? When should I work with interfaces instead of ordinary objects?
kind regards
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|