[Home] [By Thread] [By Date] [Recent Entries]

  • From: "Al B. Snell" <alaric@a...>
  • To: Uche Ogbuji <uche.ogbuji@f...>
  • Date: Wed, 23 May 2001 14:20:30 +0100 (BST)

On Wed, 23 May 2001, Uche Ogbuji wrote:

> > No! Polymorphism! The existing code relies on an object implementing a
> > given interface, and you can write other classes to implement that
> > interface and swap them in, you don't have to subclass the existing
> > "Customer" class.
> 
> No.  Inheritance.  This is part of my core point: OO has a very limited
> concept of polymorphism, which is really just late binding.  OO restricts
> late binding to sub-type constraints and thence sub-class function
> dispatch.

Depends what OO system you chose :-)

Sub-type can be boiled down to "provides interface X" if you use proper
interfaces / abstract classes. Providing the same interface is a pretty
minimal requirement for "interchaneability". You don't have to inherit
your proxy Customer from the original Customer object, you just have to
provide the same interface.

> My point is that you can get all the benefits of swapping in the Customer
> code without late binding tied exclusively to inheritance.  IOW,
> polymorphism is much bigger than OO.

Gimmee an example, I don't totally follow you...

ABS

-- 
                               Alaric B. Snell
 http://www.alaric-snell.com/  http://RFC.net/  http://www.warhead.org.uk/
   Any sufficiently advanced technology can be emulated in software  


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member