Re: How's dot.net doing nowadays?
- From: David McDivitt <david-del@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 22 Jan 2008 12:49:13 -0600
From: "Ralph" <nt_consulting64@xxxxxxxxx>
Date: Tue, 22 Jan 2008 10:35:00 -0600
Lines: 61
Both of you are chewing on the same concepts and I know you know what you
are talking about, but your terms are a little disconcerting.
Inheritance is the ability to provide generalization or specialization,
depending on the direction of your view. VB can express that.
What you are calling "full inheritance" is "Implementation Inheritance". It
is a mechanism of a OOPL that allows one to take existing code (an
implementation) and use it with additional instructions to create an new
class (or type). VB doesn't provide that ability, although the IDE does -
all Forms are derived from a base Form (aka Mr. Thunder).
You can achieve "Inheritance" in VB through two different mechanisms. You
can take the existing class, copy it, and then with Copy 'n Paste create a
new Class, or you can provide a new Interface and make your changes there.
It is important to appreciate that at runtime the new instructions produce a
new single object. The fact you built it using language constructs (as in
C++), copy 'n paste, or through a new Interface, is irrelevant. VB DOES
support inheritance.
Polymorphism is the ability for different objects do "the right thing"
through a single name. VB supports polymorphism by "Interface Inheritance".
And does it well. Note the mechanism is identical but the intent is
different. It might also be interesting to note that "Interface Inheritance"
is comparatively awkward in C++ in terms that you have to rework existing
code, where as in VB you just tack on.
You can do inheritance very easily in VB. The only difference is that there
is no keyword like java or .net. To do inheritance you simply create a new
class and instantiate the class you want to inherit within the new class. If
you make the class you instantiate public, you can access all methods in the
class through the parent using parent.whatever. The only difference with
supposed true inheritance is that the "parent." is not required and stuff
flows through because of the magic inherit keyword. This form of inheritance
takes the same amount of processing. When the new class is used, the
original inherited class is also instantiated and used. Java must make both
classes, too. To be honest, inheriting with VB in the way I described is
probably more efficient because fewer lookup tables and less mapping is
needed to support methods.
Object Orientated programming is a methodology and is by no means dependent
on whatever language. One can do object oriented programming in COBOL. It
might take a bit more work to create the whimsical abstract objects, but
it's certainly doable. To create an object in COBOL place a comment at the
top of the module that says "OBJECT: MyObject".
I like the object oriented approach. Using it in java helped me do all
languages better, even the supposedly non object oriented languages. That's
because object orientation is a way of thinking more than anything else.
--
dgm
.
- Follow-Ups:
- Re: How's dot.net doing nowadays?
- From: Ralph
- Re: How's dot.net doing nowadays?
- References:
- Re: How's dot.net doing nowadays?
- From: Karl E. Peterson
- Re: How's dot.net doing nowadays?
- From: Chris Anderson [MVP-VB]
- Re: How's dot.net doing nowadays?
- From: Karl E. Peterson
- Re: How's dot.net doing nowadays?
- From: Chris Anderson [MVP-VB]
- Re: How's dot.net doing nowadays?
- From: MM
- Re: How's dot.net doing nowadays?
- From: Steve Gerrard
- Re: How's dot.net doing nowadays?
- From: Robert Morley
- Re: How's dot.net doing nowadays?
- From: Steve Gerrard
- Re: How's dot.net doing nowadays?
- From: Robert Morley
- Re: How's dot.net doing nowadays?
- From: Steve Gerrard
- Re: How's dot.net doing nowadays?
- From: Ralph
- Re: How's dot.net doing nowadays?
- Prev by Date: Re: Desktop Trouble. XP
- Next by Date: Re: Desktop Trouble. XP
- Previous by thread: Re: How's dot.net doing nowadays?
- Next by thread: Re: How's dot.net doing nowadays?
- Index(es):
Relevant Pages
|