An Interface is just an "interface", I mean there is no actual
implementation code in an interface, only a defenition. An Abstract Class is
also possible in VB.NET, and can contain implementation code:
An interface would be more a long the lines of a "pure abstract class"
in C++. Except that there are a couple conceptual differences as far as
usuage... Usually, in VB.NET you would use an interface to give common
functionality accross dissimilar types. Where, I would use an abstract
class (MustInherit in VB.NET) when the types are related - especially if
they share a lot of implementation.
Also, Interfaces are ordinal in that they cut across the class hierachy in
their implementation.
OHM
Tom said:
An interface would be more a long the lines of a "pure abstract class"
in C++. Except that there are a couple conceptual differences as far
as usuage... Usually, in VB.NET you would use an interface to give
common functionality accross dissimilar types. Where, I would use an
abstract class (MustInherit in VB.NET) when the types are related -
especially if they share a lot of implementation.
An interface doesn't have any implementation. It only defines the
"look" of the interface. In VB.NET, a 'MustInherit Class' comes close
to an abstract class as known from other programming languages like
Java.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.