Re: User Controls (Active X) - Da Process

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Larry Serflaten wrote:
"Ralph" <nt_consulting64@xxxxxxxxx> wrote

I get annoyed everytime I hear the expression "VB cannot do *real*
inheritance".
<snipped for brievity>

I'd agree with that sentiment. VB can't do 'real' inheritance.

For me inheritance includes the implementation as well as the
interface.

VB's 'interface inheritance' is more like interface duplication, from
which you get polymorphism. When a VB class implements an interface,
it has to implement all the members of that interface, even where the
code is a duplication of whats in the base class.

Even if the class delegates to an internally held base class, its
still a duplication in that the world calls on an inheirited member,
and the class in turn calls on the base class member. A process that
is duplicated for every level of inheiritance.

Another thing which doesn't sit right with me, if B inheirits A,
and C inheirits B, then the C object should be able to called
like an object of type A. Something VB's 'interface inheiritance'
doesn't do. In other words, it doesn't go multi-levels, like 'true'
inheiritance should....

<insert>2 cents</insert>
LFS

Agree on all counts.

But appreciate that what you are describing are all coding constructs, or
tools, that may be available to an OOPL to make an OO programmer's life
easier and aid in producing a better representation in code of a particular
OOA/OOD model. It has no impact on whether VB, as feature limited as it is
as an OOPL, can or can not do *real* inheritance.

Nor more specifically have any impact on whether or not the OP can implement
a solution in VB.

-ralph



.



Relevant Pages

  • Re: Pulling my hair out, I need some help
    ... base class was just that i noticed that a base class saved me more typing ... as using the interface, to the other programmers in my company i made both ... is that the plug-in must meet. ... Inheritance, it is less clear which methods and properties of the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Deriving - .NET example
    ... the case of the lack of multiple implementation inheritance: ... could try to use aggregation to implement several interfaces at once, ... Inheritance is so easy because with three lines of code you get all the functionality of the base class + the public interface of the base class + access to its protected members + the possibility to override some of its implementation. ...
    (comp.object)
  • Re: User Controls (Active X) - Da Process
    ... VB can't do 'real' inheritance. ... For me inheritance includes the implementation as well as the interface. ... code is a duplication of whats in the base class. ... duplicated for every level of inheiritance. ...
    (microsoft.public.vb.general.discussion)
  • Re: difference between inheritance and interface?
    ... By implementing an interface, your object guarantees that the methods laid ... By extending a base class (inheritance), you inherit from the base class ...
    (comp.lang.java.programmer)
  • Re: Tired of 100s of stupid Getter/Setter methods
    ... but interface does not hide the other methods of implementing ... telling you that you need to refactor a new common superclass. ... Again, composition instead of inheritance. ... A StringVector cannot take Integer parameters. ...
    (comp.lang.java.programmer)