[dba-VB] Inheriting collections

Jim DeMarco Jdemarco at hudsonhealthplan.org
Thu Aug 4 07:00:13 CDT 2005


I was pretty busy at the time of your original post but a quick take would be that inheriting from a collection will help keep your syntax a bit cleaner:

<InheritCollection>
	objSysVarTbl.CollectionMethod
</InheritCollection>

<AddCollectionVariable>
	objSysVarTbl.CollectionObject.CollectionMethod
</AddCollectionVariable>

HTH

Jim DeMarco

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of John W. Colby
Sent: Wednesday, August 03, 2005 11:09 PM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] Inheriting collections


No thoughts on this subject?

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of John W. Colby
Sent: Monday, July 25, 2005 7:18 PM
To: dba-vb at databaseadvisors.com
Subject: [dba-VB] Inheriting collections


Being new to this inheritance thing (in the last 15 years), I have a
conceptual question:

In my SysVarRec I use a data class (or structure) that holds one record's
worth of SysVar data from a specific table. I use a SysVarsTbl class that
holds a collection of SysVarRec instances. This class loads all of the
sysvar records from a single table, loading each record's data into a
SysVarRec class or structure. I use a SysVars class which loads one or more
instances of SysVarsTbl, storing each SysVarsTbl class into a collection.
ADDITIONALLY, this class then merges all of the SysVarsTbl class' data into
a single collection of SysVars.  This collection is nothing more than a
keyed collection, where the value is stored, with a key to index into the
collection.  The objective here is to allow several different copies of a
SysVars table to exist, where the "last loaded wins".

For example, suppose I have a SysVar called EnableZip, whose value is
True/False.  If True the Zip functionality is loaded as the framework sets
up.  In the framework's copy of tblSysVars, EnableZip exists but is set to
false.  Thus as the framework initializes, the zip functionality is not
loaded.  In the application's copy of tblSysVars, EnableZip is True because
this application needs to zip files.  The tables load Framework.tblSysVar
and then Application.tblSysVars.  EnableZip=false loads from the framework
table, but then the EnableZip=True loads from the application table loads
and "overrides" the framework's SysVar.  What really happens is that the
EnableZip is found already loaded and changed from False to True.  Thus by
the time the application table finishes loading, EnableZip is True and the
zip functionality of the framework loads.

Well, you get the idea anyway.  Think up your own scenario.

The question now is...

Since a class can be inherited, should SysVarsTbl inherit the collection
class so that all of the collection functionality is native to the
SysVarsTbl class?  Or should the SysVarsTbl class simply have a collection
class variable that it sets up and loads an instance of the collection
class?  IOW, SysVarsTbl needs a collection but it could BE a collection or
it could just dim and use a collection.

VBA did not have this ability, so I became accustomed to just "consuming"
collections, i.e. using them.  But now the class that needs a collection
could BE a collection class, with all of the functionality of the collection
class inherited right in and specific non-collection functionality added to
it (loading records out of a table for example).

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
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".
***********************************************************************************




More information about the dba-VB mailing list