Re: The Point of Object Classes
From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 01/26/05
- Next message: Jeff Johnson [MVP: VB]: "Re: VB.NET EM_STREAMOUT Code"
- Previous message: Mike D Sutton: "Re: Does VB6 localise boolean variables?"
- Maybe in reply to: Rob Nicholson: "Re: The Point of Object Classes"
- Next in thread: Compu-Pikachu: "Re: The Point of Object Classes"
- Reply: Compu-Pikachu: "Re: The Point of Object Classes"
- Reply: Karl E. Peterson: "Re: The Point of Object Classes"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 Jan 2005 08:45:52 -0600
"Karl E. Peterson" <karl@mvps.org> wrote in message
news:ONpQYNxAFHA.2540@TK2MSFTNGP09.phx.gbl...
> Compu-Pikachu wrote:
> >> Createable "objects" in VB4 were a bit contrieved/forced.
> >
> > Please clarify.
>
> I wouldn't necessarily agree. See http://vb.mvps.org/vb4ht/contents.asp
for a bunch
> of sample projects written for/with VB4, most of which are moderately to
heavily
> class-dependent.
> --
> [Microsoft Basic: 1976-2001, RIP]
>
As it is often pointed out - you can usually write anything using any tool
if you are persistent enough. But why?
So it is true that one could create 'objects' in VB4, but who among us
would'nt consider losing a few of the following features, introduced since
VB4, to be a serious hinderance to using 'objects'.
1) Ability to create ActiveX Controls.
2) Ability to define multiple interfaces to group properties/methods into
functional units. VB4 allowed only a single Interface.
3) Ability to reuse interfaces in other classes.
4) Ability to extend polymorphism (additional interfaces) after a class has
been deployed.
5) Ability to use polymorphism to attain early binding. (vb4 is all late,
and slooooowwww. Also a kind of VBA 'script' contraption in comparison to
VB5/6.)
6) Ability to raise events from your own class. (VB4 'objects' are blind and
mute in comparison.)
7) Ability to use enums in classes.
8) Improved Object Browser. (For once you could actually 'see' elements like
the rest of Windows saw them.)
9) Improved debugging of classes (Break in Class Module or Break on all
errors)
[VB4 was late binding and often difficult to step into - you did a lot
of run and see what came back.]
10) Procedure Attributes dialog box. (The very box that Bruce McKinney often
called the dialog from hell. <g> Still it allowed additional functionality
such as enum and default properties for collection classes.)
11) For Each.Next syntax for collection classes. If you wrapped a collection
in VB4 ForEach was lost.
12) Ability to define variable arguments and typed optional arguments for
Properties.
13) Ability to create "Global Objects". Creating function libraries without
having to declare an Object variable and creating an object. (This is sort
of anti-class, but a feature we tend to forget was not availble in VB4, and
definitely completes the circle.)
14) Ability to create Friend methods so classes in ActiveX components can
talk to each other without exposing classes to the outside world. (Can you
spell 'encapsulation'?)
15) Ability to pass UDTs between classes using Friend.
16) Ability to define a property that can return an array. (Along with this
the ability to assign a dynamic array to any other dynamic array.)
18) Ability to pass UDTs between classes (Alas! Public only)
19) Ability to create Data Aware classes that define a data source or data
consumer. Which includes the ability to bind "any" datasource to any
dataconsumer class. VB4 only allowed you to do this with inherent controls.
20) Ability to use PropertyBags to manage Class persistence.
Of course I left off all the other minor improvements like compiling to
native code, reuse of components, ...
Now open those sample applications and see how they can be improved using
the features above. Compare them with the new, and then ask yourself - do I
really want to go back there?
-ralph
- Next message: Jeff Johnson [MVP: VB]: "Re: VB.NET EM_STREAMOUT Code"
- Previous message: Mike D Sutton: "Re: Does VB6 localise boolean variables?"
- Maybe in reply to: Rob Nicholson: "Re: The Point of Object Classes"
- Next in thread: Compu-Pikachu: "Re: The Point of Object Classes"
- Reply: Compu-Pikachu: "Re: The Point of Object Classes"
- Reply: Karl E. Peterson: "Re: The Point of Object Classes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|