[AccessD] OT: VBA.Net collections

John Colby jcolby at colbyconsulting.com
Thu May 15 19:13:46 CDT 2003


I absolutely understand what you are saying.  My thought was that part of
the functionality of this class was that it had to have a collection, thus
the "having a collection" was one of it's properties.  If I don't do what I
discussed, then I have to add a collection object variable.

However if thought of in terms of naming... let's just make up an example.

Let's call the class I am designing Car, and the objects placed in the
collection as doors.  If I don't use a variable pointing to a collection,
then the syntax to manipulate the doors (in place) would be Car(1).Handle
(for example).  If I use a variable, it would be Car.Door(1).Handle.  From
that perspective, the second (generally used) method is superior since the
first method makes readability obscure.

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Jim DeMarco
Sent: Thursday, May 15, 2003 7:53 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] OT: VBA.Net collections


John,

Although it seems like it may be the same difference I think it breaks the
philosophy (if you will) of class development.  If you design your classes
to handle one set of functionality (as class definition normally calls for)
then this would dictate keeping the object and all its methods and
properties and its collection with its methods and properties separate.

Just my opinion but I'd keep them separate (and do).

Jim DeMarco
(from home)

-----Original Message-----
From: John Colby [mailto:jcolby at colbyconsulting.com]
Sent: Thursday, May 15, 2003 5:38 PM
To: AccessD
Cc: VBA
Subject: [AccessD] OT: VBA.Net collections


I am looking at implementing some classes that have defined functionality
and properties.  However the class also needs a collection to hold other
items (instances of a specific class.  I read about the idea of subclassing
a collection to define the object that the collection can hold by overriding
the Add method.  Is there any reason not to just go the whole way and make
the collection class my object class.  IOW, add my methods and properties to
a subclassed collection class, naming the new class to MyObject.

John W. Colby
www.colbyconsulting.com


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from Hudson Health Plan (HHP) that is
confidential or privileged.  If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
contents of this message is strictly prohibited.  If you have received this
message in error or are not the named recipient, please notify us
immediately, either by contacting the sender at the electronic mail address
noted above or calling HHP at (914) 631-1611. If you are not the intended
recipient, please do not forward this email to anyone, and delete and
destroy all copies of this message.  Thank You".
****************************************************************************
*******

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list