|
-
Oct 4th, 2006, 05:51 PM
#5
Banned
Re: [2005] Abstract/Interface/Class?
 Originally Posted by jmcilhinney
Think of it this way: a base class is something that a class IS, while an interface is a role that a class can fill. In the real world you have the Printer class. You cannot create a Printer object without it being a specific type of printer, so Printer is an abstract class. Now many printers provide a USB interface, but then so do scanners, digital cameras and God knows how many other incredibly varied peripherals. They don't inherit the Printer class but they all provide a USB interface, so they can all be plugged into a computer's USB port. Remember that OOP has been designed to mimic real life.
I'm not one to judge, but every time I read jmcilhinney's responses I feel like I've learned to look at something in a different perspective. I'm fully aware of how OOP, and I definately know when or when not to interface, inherit, polymorph and all those cool buzz words . However, I think when jmcilhinney (God i wish I knew your first name cause typing that is not fun) explains something it has a great meaning. To that I say GREAT EXPLANATION!
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
|