interface? abstract class?

  • Thread starter Thread starter Hei
  • Start date Start date
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:

Public MustInherit Class Test
'...
End Class

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
Hi

is vb.net' "interface" is sound like C++ "abstract class" ?

Hei

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.

Regards - OHM# (e-mail address removed)
 
* "Hei said:
is vb.net' "interface" is sound like C++ "abstract class" ?

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.
 
Back
Top